I need to update a People custom field via Automation for Jira. Specifically, I want my custom field ("Work It" or "customfield_10150") to be set to a specific user, "service.center".
service.center is defined as:
{
}
Unfortunately, the Automation for Jira's Edit Issue action does not find my custom field, "Work It", in its dropdown. Therefore, I need to leverage the Additional fields textbox (i.e., JSON). In that textbox I've added:
{
"fields": {
"Work It" : { "id":"5e7a27d154fa650c3bc1b488" }
}
}
When I run this automation I get the following error:
Note: I have validated that "Work It" is indeed "customfield_10150"
What am I doing wrong? Thanks!
@pbrdebruijn, this error is typically because the JSON is not correct when running the rule.
For fields that take an array of single field object:
{
"fields": {
"Multi User Customfield": {{issue.parent.Multi User Customfield.accountId.asJsonObjectArray("id")}}
},
}
This webiste has some examples of how to use the JSON functions to ensure your values are compiled correctly: https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/
This is where the function details are: https://support.atlassian.com/jira-software-cloud/docs/smart-values-json-functions/
Thanks for the response. I was able to solve this need leveraging the array syntax even though this user field is single user constrained. The working JSON is:
{
"fields": {
"Work It" : [ { "accountId":"5e7a27d154fac50c3bc1b488" } ]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is odd that it works; I have a similar issue with single entry people picker but I am assigning the value (what Paul has as "5e7a..." from a text field (custom):
{
"fields" : {
"Work It" : [{"Username" : "{{issue.customfield_123456.value}}" }]
}
}
And this gets (if [ ] are surrounding): "data was not an object (Work It))"
If I remove the [ ] it gets success but does not update Work it.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The following syntax worked for me so I could append a value from 1 custom field to a different, multi select custom field:
{
"update": {
"Custom Field 1": [{
"add": {
"value": "{{issue.Custom Field 2}}"
}
}]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.