Hi all,
I've found some matches to my question and tried working through them but was unsuccessful so I'm reaching out for additional help.
What I'm trying to do:
Where I'm stuck:
I'm able to:
I'm not able to:
What I've tried:
When I use cURL:
When I use Insomnia (Postman equivalent):
I'd post the full source but it probably won't be useful because everything appears to work except for the update of the ticket at the end.
So it turns out POST is not available for the http://domain/rest/api/2/issue/{issueIdOrKey} endpoint so a PUT request is required. The correct json to send as well as the whole request (using the Python requests library) is below.
update_url = 'https://' + credentials.JIRAPOCDomain + '.atlassian.net/rest/api/2/issue/' + str(key)
update_headers = {'Content-Type': 'application/json', 'Accept': 'application/json','X-Atlassian-Token': 'no-check'}
update_data = {"update" : {"customfield_13222" : [{"add" : {"value" : root_cause_value}}]}}
request = requests.put(update_url,data=json.dumps(update_data),headers=update_headers,auth=(username,token))
key is the jira issue key
root_cause_value is a variable that stores the value I'm trying to add to the custom field
Are you sure you want to use http://domain/rest/api/2/issue/{issueIdOrKey}/editmeta and not http://domain/rest/api/2/issue/{issueIdOrKey}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I actually figured it out after I posted this but my post wasn't showing up in my history or anything so I couldn't update it with the answer, now that it actually shows up I'm going to update everything, thanks for your response. What I didn't realize is the API I was calling doesn't allow POST, so I used PUT instead. I also had to use http://domain/rest/api/2/issue/{issueIdOrKey} and NOT http://domain/rest/api/2/issue/{issueIdOrKey}/editmeta
This is the correct form of it
update_url = 'https://' + credentials.JIRAPOCDomain + '.atlassian.net/rest/api/2/issue/' + str(key)
update_headers = {'Content-Type': 'application/json', 'Accept': 'application/json','X-Atlassian-Token': 'no-check'}
update_data = {"update" : {"customfield_13222" : [{"add" : {"value" : root_cause_value}}]}}
request = requests.put(update_url,data=json.dumps(update_data),headers=update_headers,auth=(username,token))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.