Teams option unable to edit using automation

Raju Mandapaka
Contributor
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
Contributor
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
Contributor
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
AB September 10, 2024

I just tried the solution provided here but it didnt work for me. I am posting the screenshots here, If anyone can help

1.png2.png3.png

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.
September 10, 2024

Hello @AB 

The only people who see your updates on this question that is almost a year old are the original poster and people who have responded.

To get the best visibility from the community on your question, please start a brand new Question post.

If this post here is relevant to your situation, include a link to it in your new post.

I also note that this post here concerns Jira Cloud, while your images indicate you are using Jira Data Center. The solution in this post may not be appropriate for your environment.

MD
Contributor
September 18, 2024

Hey @AB , 

The quality of your images is low, but based on the available details, it appears that certain parameters have been incorrectly combined. Please consider using the following corrected approach:

First, identify the customfield id of your Team field. In my case it is 10100. Once done, proceed with one of the options based on your needs:

- 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 -- 48324-2363465sdf-sfgh5 in the code block below:

{
"fields": {
"customfield_10100" : "48324-2363465sdf-sfgh5"
}
}

- If you want it to set the destination issue's Team field to a dynamic value and automatically taken from the triggered issue (IMPORTANT: If such exists!), then you do this:

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

Hope it helps you understand it better.

Regards. 

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