I need to set a field a custom field in Jira issue. This field has Insight type and is a single selection.
I tried to search community and Insight documentation but they are outdated and misleading, so this is what I found. In the end I will show you the way to find answers yourself.
Field: customfield_14472
Issue: ADM-262
Object Key: AR-8155
As usual, add Edit Issue fields action, do not select field in Choose fields to select.
Copy paste the following text into Additional fields section (under more options)
{
"fields": {
"customfield_14472": [{
"workspaceId": "e02eca9b-beba-4406-bcbc-6c95dcb24212",
"id": "e02eca9b-beba-4406-bcbc-6c95dcb24212:8155",
"objectId": "8155"
}]
}
}
What is workspaceId? It is your Insight database id. There is no easy way to find it, if you know it please tell me in comments. This is how I discovered it.
1. Prepare a test ticket, say ADM-262
2. Find the field and set a known value to it. E.g. Customer Name
3. Go to your Insight database and find the customer. Recall the Key of the object, say AR-8155
4. Copypaste this url to you browser
https://<your company>.atlassian.net/rest/api/latest/issue/ADM-262
The page will show you large json with plenty of info. Press Ctrl+F and find your customer Key, in my case it is 8155.
"customfield_14472":[{"workspaceId":"e02eca9b-beba-4406-bcbc-6c95dcb24212","id":"e02eca9b-beba-4406-bcbc-6c95dcb24212:8155","objectId":"8155"}]
Now you can just copy this selected text into Automation and replace 8155 with whatever you receive from your rule.
This receipt works pretty much with every field type in Jira - setup it, create a test issue, set the field and receive internal representation through REST API. Then use it for automation.
I hope it helps!
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Jira Administrator
Configure Jira Software, Jira Core, or Jira Service Management, including global settings, permissions, and schemes.
Managing Jira Projects Cloud
Learn to create and configure company-managed projects in Jira Software and partner effectively with Jira Admins.
Learning Path
Become an effective Jira Software Project Admin
This learning path is designed for team leaders who configure Jira Software projects to match a team's processes.