My aim is to integrate our Salesforce.com platform with our Jira Service Management platform.
For this, I'm first using Postman to test my API call-outs, but I'm currently stucked on this problem: I can't manage to update the text custom filed I created (customfield_10082) to set back the reference from Salesforce object I create from Jira issue.
In order to update this field I'm doing a PUT on http://MYJIRA.atlassian.net/rest/api/3/issue/{issuekey}, using following JSON:
{
"fields": {
"customfield_10082" : "SFDC Ref"
}
}
Postman is receiving a "200 OK" response code, but when looking at the received JSON or in the Jira app itself, I can see my custom field remains desperately empty:
"customfield_10082": null
When doing a GET on http://myjira.atlassian.net/rest/api/2/issue/SP-13/editmeta I'm getting the following definition for the field I need to update through REST API:
"customfield_10082": {
"required": false,
"schema": {
"type": "string",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:textfield",
"customId": 10082
},
"name": "ST Reference",
"key": "customfield_10082",
"operations": [
"set"
]
}
Am I missing something? Maybe am I required to use this "set" operation for the update?
But what's the syntax for using it in my JSON in this case? Or do I have to use the "update" verb instead of "fields" for the update?
I found this example for setting components, but I don't know how to apply this to my custom field:
{ "update" : { "components" : [{"add" : {"name" : "Engine"}}] } }
source: Jira REST API examples (atlassian.com)
Note that the same page also seems to confirm above JSON structure I am currently using for custom field (free text) update. I just feel like I'm going in circles...
Thanks a lot for your help!
Hello @Laurent Delhaie
Can you confirm the end point you are using? You have it as below:
http://MYJIRA.atlassian.net/rest/api/3/issue/{issuekey}
But the syntax is not right. It should be:
http://MYJIRA.atlassian.net/rest/api/3/issue/{{issuekey}}
Other than that, everything looks good.
this field allows only "set" operation and using "fields" you are implicitly doing a set. So that's good. Even the meta info shows its a text field so the way you are updating is the correct way.
Please cross check the smart value in your endpoint. Hope it helps. Thanks!
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.