0

Good Day All, I've been looking around the past few days trying to find the right syntax to build my request. Many articles on SO and even Atlassians Docs, but I havn't found anything that would fit my needs. I have a custom field in Jira which is a Select List (Multi select field). I would like to set the value of this with a curl command. Here is what I am currently trying

curl -D- -u *:* -X PUT --data "{\"customfield_10614\": [ { \"id\": \"13500\" }, { \"id\": \"13400\" } ] }" -H "Content-Type: application/json" http://jira.*.com:8080/jira/rest/api/2/issue/MMB-3039

I've tried many variations of this same command looking for the right syntax.

Other curl requets work for me such as

curl http://jira.*.com:8080/rest/api/2/issue/EI-1?fields=customfield_10613

and

curl -D- -u *:* -X POST -d "{\"body\": \"Comment added when resolving issue\"}" -H "Content-Type: application/json" http://jira.*.com:8080/rest/api/2/issue/EI-3324/comment

But i am currently getting "HTTP/1.1 403 Forbidden" as a response to my request to update the Select List.(not sure if it should be a post or put)

Any recommendations would be appreciated!

Thank you

2
  • It's not a permissions issue? Commented Feb 6, 2019 at 17:49
  • I don't think its a permission issue, as I am able to login manually and make this edit. I am also able to leave comments using REST Commented Feb 6, 2019 at 20:08

1 Answer 1

2

Solved. After trying some different syntaxes I came across the correct format.

curl -D- -u *:* -X PUT --data "{\"fields\" : {\"customfield_10614\": [{ \"value\": \"TST1\" }, { \"value\": \"TST2\" }]}}" -H "Content-Type: application/json" http://jira.*.com:8080/rest/api/2/issue/MMB-1000
  1. I needed a PUT instead of POST
  2. The url should not have the /jira directory after the port
  3. Json --data was not in correct format
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.