I’m trying to update a custom field in JIRA called ‘resolution description’ when the resolution status changes to ‘fixed’. I thought using the ‘transition’ REST API call would do the trick, but it’s not working as expected. Here’s the JSON I’m sending:
The errorDetails variable contains some hardcoded text. Am I missing something? Can these two fields be modified with a single ‘transition’ API call? Any help would be appreciated!
I’ve encountered this issue before, and there are a few potential solutions. First, double-check the field ID you’re using. It’s likely not ‘resolution_notes’ but something like ‘customfield_10XXX’. You can find this in the JIRA admin panel or by inspecting the issue’s JSON response.
For text fields, the update structure should typically look like this:
Also, ensure your JIRA instance allows field updates during transitions. Some configurations restrict this. If all else fails, you might need to perform the transition and field update as separate API calls. It’s not as elegant, but it often works when the combined approach fails.
Lastly, verify that your user account has the necessary permissions to make these changes. JIRA’s permission system can be quite granular and might be blocking the update.
hey, i’ve had some luck with this. ensure you use the right field id - often it’s something like ‘customfield_10000’. also, check your permissions as jira can be nitpicky. if nothing works, consider separate api calls for transition and field update.
I’ve dealt with a similar situation before, and I can offer some insights. The ‘transition’ API call can indeed update custom fields, but there are a few things to keep in mind.
First, make sure you’re using the correct field ID for your custom field. ‘resolution_notes’ might not be the actual field ID. You can find the correct ID by looking at the field configuration in JIRA or by making a GET request to the issue and inspecting the response.
Secondly, the structure for updating custom fields can vary depending on the field type. For a text field, you might need to use a structure like this:
"customfield_10000": [{
"set": "Your text here"
}]
Replace ‘customfield_10000’ with your actual field ID.
Lastly, ensure you have the necessary permissions to modify the field. Sometimes, certain fields are restricted based on user roles or workflow conditions.
If you’re still having trouble, you might want to try making separate API calls for the transition and field update. While less efficient, it can help isolate where the problem is occurring.