Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding What is the REST API call for adding a fix version to a Jira item

Linda Hurrell May 2, 2018

Regarding this link REST-API-call-for-adding-a-fix-version-to-a-Jira

 

I am submitting a jira item from another system (SBM) using cURL and the POST option.  I found the link very helpful to get the syntax correct regarding set or add but when I create my item it doesn't populate the fix version field and there are no error messages at my end and none on the Jira logs.

 

I think I'm missing something!

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2018

You should create a version first with POST /rest/api/2/version and then you can set this version for an issue with PUT /rest/api/2/issue/{issueIdOrKey}

And Jira always returns a message in JSON format after REST execution. How do you execute your REST call?

Linda Hurrell May 2, 2018

Hi Alexey,

Thanks for replying. My POST  statement is creating a new Jira item with various fields taken from an item in my SBM system. So within the post statement, I include a  section for the fixVersions field.

"fixVersions":[{"set":[{"name":"productname"}]}],

I have tried it with add as well (using the slightly different format) but that doesn't work wither.  I put the Jira return message in an output file which does not contain any errors or references to this field.  The item is created correctly with all the fields I send over apart from this one.

We execute the REST call using cURL via a command line from within a script (which we have been using for some time minus the fixVersion field). The input mentioned below contains all the fields we want to add.

 

string = "c:\curl\cURL\bin\curl -D c:\curl\cURL\bin\log.txt -u userid:password-X POST --data @" & input & " -H " & quote & "Content-Type: application/json" & quote & " https://url/rest/api/latest/issue -v -k > " & output & " 2>&1"

response = Ext.CmdLineWait(string)

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2018

Ok, try to do it this way. Install Rest Api Browser to your Jira instance. Then execute your POST method through the Rest Api Browser. It will show you the error.

Linda Hurrell May 8, 2018

Hi Alexey, Thank you for this. My colleague installed the Rest API Browser and we were able to see that in fact we just needed to omit the Set or add section and it worked.

Feni Veronica Manurung
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 29, 2019

@Linda Hurrell Can you please tell me more detail about how you add the fox version? thank you

Suggest an answer

Log in or Sign up to answer