It’s been a while since I really dug into Perl but if memory recalls I would look at the url module (if memory serves me as well - there’s an Lwp module). That in conjunction with basic auth (in cloud look at api tokens for the passwords) you should be able to use the rest of the docs.
# create a project
my $project = $jira->POST('/project', undef, {
key => 'PERL',
name => 'Perl example',
projectTypeKey => 'business',
#some more required parameters in the docs
...
});
But then an error occurs.
F:\ideaic\perl\site\lib>perl ideaic_interface_jira_create.pl
JIRA::REST Error[400 - Bad Request]:
-Unrecognized field “leadAccountId” (Class com.atlassian.jira.rest.v2.issue.project.ProjectInputBean), not marked as ignorable
at [Source: org.apache.catalina.connector.CoyoteInputStream@1c4b8d2f; line: 1, column: 196] (through reference chain: com.atlassian.jira.rest.v2.issue.project.ProjectInputBean[“leadAccountId”])
at ideaic_interface_jira_create.pl line 62.
F:\ideaic\perl\site\lib>
“line 62: my $project = $jira->POST(’/project’, undef, {”
It looks like this is due to “leadAccountId”.
Where can I find the “leadAccountId” value?
In my understanding, you’re targeting a Jira server deployment, hence, leadAccountId is not necessary. Kindly check Jira server’s Create project REST API.
However, the following error occurs.
F:\ideaic\perl\site\lib>perl ideaic_interface_jira_create.pl
JIRA::REST Error[400 - Bad Request]:
-吏?뺥븳 ?꾨줈?앺듃 ?묒떇??議댁옱?섏? ?딆뒿?덈떎. ?대떦 ?꾨줈?앺듃 ?묒떇???ъ슜?먯쓽 Jira ?몄뒪?댁뒪?먯꽌 ?ъ슜???덈뒗吏 ?뺤씤?섏떗?쒖삤. ?꾩???꾩슂??寃쎌슦 ?ъ슜?먯쓽 Jira 愿由ъ옄?먭쾶 臾몄쓽?섏떗?쒖삤.
Jira 愿由ъ옄?먭쾶 臾몄쓽?섏떗?쒖삤. at ideaic_interface_jira_create.pl line 64.
F:\ideaic\perl\site\lib>
“line 64” is “my project = jira-> POST (’/ project’, undef, {”
The reason is “my $ jira = JIRA :: REST → new ({” seems to be.
I have to use “JIRA :: REST”.
Can not I create a Jira Project using “JIRA :: REST”?
Cheer,
Alex.
I am not sure what the errors exactly mean, but my guess is that some values you used for IDs and schemes might be incorrect (it varies per instance so you need to get the correct ID). For testing purposes you can do away with commenting those out. I tried the code snippet below, commented out the IDs, and I was able to create a project successfully,
Hi, lan
Thank you very much for your help.
Depending on your help, some sources have been modified and tested.
However, the same error occurred.
So I reset the "active code page" so that the log is not broken.
And I saw the log.
It means that the "designated project form" does not exist.
So I compared my source and the Atlassian document sample source.
There was a difference in the bottom part of the results.
I modified and tested the other parts.
Wow! The test was successful.
The project has been created and the desired results have been confirmed.
Thank you very much. lan
When you come to Korea I would like to serve delicious food.
You are a wonderful person.
Cheers,
Alex.
You’re welcome, Alex. Glad to know you got it working now. Most, if not all, members of the developer community help each other out. Looking back, I’ve also got information here when I started out, so this is paying it forward