Teams option unable to edit using automation

Raju Mandapaka November 22, 2022

Team,

I am having a text drop down option with all team names, my automation should copy that value and set as a value in Teams custom field (which was originated from advanced road maps) but it is throwing errors.

Added all the screen shots.

Thanks in advance.

Automation -3.JPGAutomation -2.JPGAutomation -1.JPG

3 answers

2 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2022

Hello @Raju Mandapaka 

There are two things to address in your rule.

1. The use of asJsonString

As per the documentation here:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-json-functions/

...if "JA Team 2" is a selection list then you need to use

issue."JA Team 2".value.asJsonString

 

2. Setting the Team field in the issue.

When setting the Team field you need to use the ID associated with the Team, not the Team Name, as noted in this article:

https://community.atlassian.com/t5/Jira-articles/Automation-Set-your-Advanced-Roadmaps-Team-automatically-when/ba-p/1761588

 

So, you cannot directly take the text that represents a Team Name from another field and assign that value to the Team field.

I have not yet found information on how you could take the text name and look up the ID for the team through an automation rule.

1 vote
Alexa September 22, 2023

I was able to do this using the answer from another post: https://community.atlassian.com/t5/Jira-questions/Custom-Field-Copy-when-Splitting-Ticket-Automation-not-working/qaq-p/2258148

{
"fields": {
"customfield_10100" : "{{triggerIssue.fields.customfield_10100.id}}"
}
}

You'll need to update the ID (in the example above, it's 10100) to the ID if the Team field in your instance. You can find this by going to Issues > Custom Fields > click the ellipsis next to the Team field > click "View field information" > and copy the ID at the end of the URL of the page it opens. That's your Team field ID.

It's dynamic: whatever the value of the trigger issue's Team field is will then copy to the destination issue. 

If you want it to set the destination issue's Team field to a static value, then you can replace the smart value with the Team field's value ID. Example -- 485 in the code block below:

{
"fields": {
"customfield_10100" : "485"
}
}

If you're not sure what your Team's value ID is, then in the main navigation menu along the top of the page, select Filters > View all issues > "Switch to JQL" (if it's not already set to that) > and in the query bar, type:

"Team[Team]" = 

and wait a moment for the list of teams to pop up in a dropdown menu. You may need to backspace then hit the space bar again for it to aggregate the Teams list. Start typing your team name and select it when it pops up. It will then convert the team name to the ID. You can then copy that to your automation rule to replace the 485 number I used in the example above (be sure to keep the quotations).

Final setup of automation rule example:

issue_split_automation_rule.png

MD April 16, 2024

@Alexa 

Thank you for your solution! It works perfectly and has saved us a lot of effort. Your contribution is greatly appreciated.

Best regards!

Like Alexa likes this
0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2022

Suggest an answer

Log in or Sign up to answer