How to add in automation to copy the Team field from the triggered issue?

Sari Kachorovsky August 29, 2023

I would like to create an automation that once specific field is changed to Yes a new Story is created and the mandatory fields which are Epic Link and Team are copied from the triggered issue. I've succeeded with the Epic link but Team field is not found and I need to add a Json, I've tried few options but nothing works. Can someone please advise how the Json should look like? The example below is not working I'm getting the following: Error while parsing additional fields. Not valid JSON.

I've also tried  and it failed: 

"fields": {
"customfield_12300" : issue.customfield_12300
}

But when I gave a specific team number it worked :

{
"fields": {
"customfield_12300": "39"
}
}

image.png

2 answers

1 accepted

0 votes
Answer accepted
Marc Koppelaar - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2023

Hi @Sari Kachorovsky 

You found the resolution yourself.

This needs to happen via JSON and you need to specify the ID of the Team

Sari Kachorovsky August 29, 2023

@Marc Koppelaar - Devoteam MY solution is not good, I don't know what will be the team, I need it to copy it from the triggered issue (The RFE). The teams can be different. 

Marc Koppelaar - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2023

Hi @Sari Kachorovsky 

This will do the trick I think.

  1. Before creating an issue add the action: Re-fetch issue data
  2. Then add the action: Create Variable
    Screenshot 2023-08-29 at 16.44.20.png
  3. Then create the issue and use the json
    Screenshot 2023-08-29 at 16.44.30.png
Like BethP likes this
Sari Kachorovsky August 30, 2023

@Marc Koppelaar - Devoteam Thank Marc for your help, I've implemented your fix (beside that I've choose Story and not same issue type cuse they are different issue types) and I'm getting the attached error. Any idea why?image.pngimage.pngimage.png

Marc Koppelaar - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2023

Hi @Sari Kachorovsky 

You are missing a } at creating the variable.

The right input is:

{{issue.customfield_10001.id}}

Make sure that the Team field in you instance has the id 10001. I think it will as I think this is the default id value for field team.

Sari Kachorovsky August 30, 2023

@Marc Koppelaar - Devoteam opps u r right - I fixed it -but still getting the same error. I've tried also with customfield 12300 (cause it works for me for team in another automation) but still the same error.image.pngimage.png

Marc Koppelaar - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2023

Hi @Sari Kachorovsky 

I see you team field has the ID: customfield_12300 from your original post and there is an error in the json

You missed the closing quote " after "{{team}}

I think your json should look like this:

{
"fields":
{
"customfield_12300": "{{team}}"
}
}

Like Sari Kachorovsky likes this
Sari Kachorovsky August 30, 2023

@Marc Koppelaar - Devoteam It's working!!! Thank you so much for your help!

Moheeb Qupty April 18, 2024

@Marc Koppelaar - Devoteam 

Hi,

Why we need to "Re-fetch" and then create a variable which has the smart-value of {{issue.customfield_12300.id}}??

Why can't we use the smart-value {{issue.customfield_12300.id}} directly in JSON when copy Team to Team:

{
"fields":
{
"customfield_12300": "{{issue.customfield_12300.id}}"
}
}

 

0 votes
Collista Lewingdon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 29, 2023

Maybe the solution might be as simple as making sure that the custom field is available in your project type and is associated with your project? Once you do that you should be able to see it in your drop down menu in automations. 

This article regarding editing a custom field context might help you edit it so that is shows and is a selectable field within your automation. 

Marc Koppelaar - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2023

Hi @Collista Lewingdon 

The Team field is not available in the field dropdown in automations even if available in your project.

This is a know topic, the same applies to Epic Status.

These fields can only be addressed via a JSON statement in using more options in an automation. 

Collista Lewingdon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2023

@Marc Koppelaar - Devoteam Well that is odd because I am able to access it in automation. And...even better....custom fields that I have created can be selected in Automation. Team.png

Marc Koppelaar - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2023

Hi @Collista Lewingdon 

The default advanced roadmap team field is a fiedl created by Atlassian.

This field is visible within the custom fields (all system created or app created fields and self created).

The Team Field is a locked field and of the Type Team, this type of custom field can't be created.

See:

Screenshot 2023-08-31 at 08.44.24.png

The screen you show looks like a self created custom field, named Team. Am I correct on this assumption?

The above shown field is only usable within a JSON clause in an automation

Collista Lewingdon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 31, 2023

It is not a field that we created. It says it was generated by Jira and is locked for editing. TEAM FIELD.png

And it is the only field labeled Team in our instance of Jira. 

Marc Koppelaar - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 31, 2023

Hi @Collista Lewingdon 

What subscription of Cloud do you have on a standard I also have the field team, this is related to the teams you can setup in the Teams section in the toolbar.

The Team field I and Sari are referring to is related to Jira Advanced Roadmap, this requires a premium cloud subscription.

The Team field then is only usable in automation .

I have tried to use Team in an automation on standard and that works and I have tried it on premium and then it doesn't work anymore.

So this has to do with the addition of Advanced Roadmap.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events