It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

PUT json file into a field value

Hi all,

 

I have a file with some value in a JSON format. (Obtained with an api rest curl GET from a text area custom field) 

{"expand":"renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations","id":"888051","self":"https://jira.com/rest/api/2/issue/888051","key":"KEY-0","fields":{"customfield_13630":"Date:: 2018-06-25 14:33:06 +0200 (Mon, 25 Jun 2018)
Author:: username
Message:: This is a json test"}}

 

Can I use any api rest method to post it into a custom field directly?

 

Thanks in advance!

Best Regards

1 answer

1 accepted

0 votes
Answer accepted

Ok solved:

 

curl -k -D- -u "user:pass" -X PUT --data @file.json -H "Content-Type: application/json" JIRAURL

 

Regards

Hi Albert,

 

I have the same requirement, can you please share the complete steps you took to put the json response into Jira field?

Would appreciate your help on this.

Regards,

Raj

Hello!

This is an example for editing a text field customfield_40494 in a BUG-569. First of all, I create the json file like this:

 

{"fields":{"customfield_40494":"EXAMPLE TEXT"}

After that I upload changes to the BUG-569 using the following command:

curl -k  -X PUT --data @jsonFile -H "Content-Type: application/json" "https://JIRAURL/rest/api/2/issue/BUG-569?fields=customfield_40494";

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you