I feel this should be easy .. but somehow i cant get it to work ..
In Jira Discovery, I need an automation to populate a 'Discipline' field by combining the values from 'Team (IP)' and 'Dependency'. When either 'Team (IP)' or 'Dependency' is added or edited, the 'Discipline' field should update to show the combined values.
Currently, editing one field overwrites the other in 'Discipline', and using 'Add to existing values' results in not removing the old value.
Somehow also the automation always shows as "successful" even though the Discipline field might not get updated.
Screenshots attached
The second "then: is identical to the first one but with "Copy Dependency from current issue"
Thanks a lot
Hi @lila
What is the type of your "Discipline" field: text, single-select option, etc.?
Please show an image of your current entire rule in one continuous image. That will provide clarity for what you are seeing. When the rule is larger than a single browser page, please use a screen capture tool or browser addon which support scrolling-page capture.
Also please post an image of the entire Edit Work Item action(s) you are using. I suspect you are trying to update the field multiple times and that is causing this symptom.
Kind regards,
Bill
Hey Bill, Multi-select field.
There is not much more to show that the above, Here is he new one with the update based on comments suggested by others.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information, and...
When using the Edit Work Item action, the field may be selected from the dropdown list or updated using a JSON expression, but not both in the same action. For your scenario, please remove the selection from the dropdown list.
Next, you want to add a value not replace them, correct? If so, the syntax for the JSON update would be this:
{
"update": {
"customfield_12345": [
{
"add": { "value": "{{issue.Team (IP)}} - {{issue.Dependency}}" }
}
]
}
}
Please note I used the custom field ID as an example. You could try your field name as a smart value, "Discipline", and if that does not work, use this how-to article to identify the custom field id for your field. The same may be needed for the fields "Team (IP)" and "Dependency"
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Please note I am assuming the "Team (IP)" and "Dependency" fields are plain text. If those are single-select option, custom fields, their value attribute must be used:
"{{issue.Team (IP).value}} - {{issue.Dependency.value}}"
Again...using the custom field ID values when needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Expanding on what @Mohanraj Thangamuthu has indicated, can you try something like below or whatever will be your separator
{
"fields": {
"Discipline": "{{issue.Team (IP)}} - {{issue.Dependency}}"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, Good day. Use the JSON option to update the field as shown in the below link. https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/
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.