Automation: How to copy team value and then populate it on a newly created issue
Asked by X2EVWHAL:

I have 2 separate company-managed projects in Jira. I would like my users to be able to use an automation to send items from one project to another. Basically we stage work in one project and then move it to the other when it is ready for the teams.

My issue: I have the automations created, however instead of looking up the original team value and copying it over to the newly created item, it is defaulting to a random team in our org only.

Here are screenshots of my setup:

![jira2.png](/t5/image/serverpage/image-id/329701i21E490D5B2F6C6A5/image-size/large?v=v2&px=999 "jira2.png")![jira3.png](/t5/image/serverpage/image-id/329699iDA2CCD99E9DB60E9/image-size/large?v=v2&px=999 "jira3.png")![jira4.png](/t5/image/serverpage/image-id/329700i11C07410F0D1E1E7/image-size/large?v=v2&px=999 "jira4.png")


Answers:
author: Bill Sheboy
body: Hi [@X2EVWHAL](/t5/user/viewprofilepage/user-id/5520244) -- Welcome to the Atlassian Community!

I am unclear what you are trying to accomplish as your rule:

* Uses advanced edit with JSON to **repeatedly set the Team field** to different values. I believe only one value should be passed when setting the Team.
* Same thing as above, except editing the trigger issue.

What do you mean by "looking up the original team value"? Do you mean using the Team value from the trigger issue?

Kind regards,  
Bill

comments: author: X2EVWHAL
body: Hey [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) thanks for your response.

I would like for the automation to copy over all fields into a new issue in the destination project. I am able to copy all fields over except for the Team field.

What I tried to accomplish in the advanced JSON of the automation is capturing the Team value on the trigger issue and mirroring the same value on the destination issue. I'm no expert and I'm sure that I just need to edit the advanced JSON to read the team value and update it on the newly created issue.


author: Bill Sheboy
body: Thanks for that information.

I recommend first checking if the Team field is available in the fields dropdown for the Issue Edit action. If it is, remove the JSON and select Copy from Trigger Issue for the field.

If the Team field is not in the dropdown, the advanced edit with JSON is required. You should only specify one team value, copying from the trigger issue, rather than a list of teams. For example:

```
{
  "fields" : {
    "Team" : "the ID value for one team"
  }
}
```

If that does not work, try using the custom field id in place of "Team" in the JSON. You may find the custom field id using this how-to article: <https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>


author: X2EVWHAL
body: Thank you, Bill.

I was able to look up the custom field ID using your article, but I'm still getting an error when I have it set up like this

```
{"fields":
{ "Team": {{customfield_10001.value}}
  }
}
```

Not sure that I have the JSON right, but with your help I think I'm getting closer.


author: Bill Sheboy
body: I believe you need the id for a Team field type, and the value must be in quotation marks. Please try this:

```
{
  "fields": {
    "Team": "{{triggerIssue.customfield_10001.id}}"
  }
}
```

If that does not work, please post an image of the error from the audit log details.


author: X2EVWHAL
body: That did the trick! Thank you, [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) for your quick and helpful responses!


Tags: cloud

jira-cloud