Hello Atlassian Community,
When the issue is updated I try to copy the value of the custom field of type the name 'Entity and site' to another custom field 'Entity'.
I created an automation rule for that process.
Because I want to use this field for the Pie Chard gadget both custom fields are Select List (cascading) type.
How I can copy a specific value from the custom field 'Entity and site' to the custom field 'Entity' to be set using a JSON object?
{
"fields": {
"customfield_13429": "{{customfield_10205.Entity and site.value}}"
}
}
unfortunately, these records get an error
SUPPORT-6955 (Can not instantiate value of type [simple type, class com.atlassian.jira.issue.fields.rest.json.beans.CustomFieldOptionJsonBean] from JSON String; no single-String constructor/factory method (customfield_13429))
Any help would be appreciated!
Hi Martin
Sounds like you have one cascading select list and you want to copy the value and child value to another cascading custom field
If that is the case you can try something like
{
"update": {
"select list 2 (cascading)": [
{
"set": {
"value": "{{select list cascading.value}}",
"child": {
"value": "{{select list cascading.child.value}}"
}
}
}
]
}
}
where select list 2 (cascading) is the same of the field to be updated from select list cascading
Hi @Support Team [Clearvision] thank you for your quick response, yes, I have two custom fields of type cascading select list 'Entity and site' and 'Entity'. Both custom fields are a lot of values and child values, I want to copy the only entity value from this custom field 'Entity and site'
example
When I select one of that values on an issue 'entity 1' from the custom field 'Entity and site' then copy entity value: 'entity 1' to the custom field 'Entity'.
I want to copy only the entity value without child value.
Thank you for any appearance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin
Thanks so if you only want the parent value you can use the same as above and remove the child key and value and just set the value
note the two lists will need to have the same values available
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Support Team [Clearvision] thank you! automation rule has been successfully set up and works as expected
note: that JSON working with custom fields of type select list (cascading) and (single choice) as well
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Martin Beke
You can always get the issue's JSON data and check how data is stored using this end point.
/rest/api/3/issue/abc-123
In your rule what are the field types?
Also take a look at the smart value documentation to learn how to fetch values.
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
update: the automation rule has been successfully configured on the previous comment
Hi @Ravi Sagar _Sparxsys_
thank you, in my rule are custom fields of type cascading select list. Both custom fields are a lot of values and child values, I want to copy the only entity value from this custom field 'Entity and site'
"customfield_10600": null,
"customfield_10205": {
"self": "https://mycompany.atlassian.net/rest/api/3/customFieldOption/10112",
"value": "LIB",
"id": "10112"
},
to this custom field 'Entity', where that value will be dynamic based on selection.
"customfield_10200": null,
"customfield_13427": null,
"customfield_11801": null,
"customfield_13429": {
"self": "https://mycompany.atlassian.net/rest/api/3/customFieldOption/13218",
"value": "LIB",
"id": "13218"
},
When I select Entity value from the 'Entity and site' custom field I expect to copy that entity value to the 'Entity' custom field.
Thank you for any ideas
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.