Automation to copy User Field from PD to JSW
Asked by Jenifer Kuntz:

When we create a delivery issue from Product Discovery we are trying to use Automation to copy fields and I am running into some issues.

I have been able to copy custom fields using Copy, Destination issue and selecting the fields.

I had a few issues with the fields being different field types in PD and JSW but worked that out but I am still stuck on People fields.

IN PD the People field looks like a multi select user field so I created that type of field in JSW. I still am not seeing the PD People field when I am trying to copy the field.

Is there another way I can copy this field over?

Thanks!


Answers:
author: Haddon Fisher
body: When you say "I still am not seeing the PD People field when I am trying to copy the field" do you mean when you go into the Automation "Edit" action and look in the list of fields in the drop-down, you don't see it?

I can't say this for certain, but the custom fields functionality in JPD projects *feels* very similar to the custom fields functionality in team-managed Jira projects. If this is true, then it would not surprise me if user picker fields were not accessible to Automation in JPD projects. For whatever reason, Atlassian excluded these from the fields Automation can access easily; see [AUTO-421](https://jira.atlassian.com/browse/AUTO-421) for more info on this and some other gaps in TMP's.

I am still somewhat banging my head against this problem myself, but it *may* be possible to use the "advanced edit" JSON options to do this though.

comments: author: Jenifer Kuntz
body: Yes, that is exactly what I am doing. I appreciate your help.


author: Bill Sheboy
body: Hi [@Jenifer Kuntz](/t5/user/viewprofilepage/user-id/527561) and [@Haddon Fisher](/t5/user/viewprofilepage/user-id/560629)

I believe the accountId attribute is available for team-managed project, People fields...and so it is most likely then available for JPD.

Setting the value may require using advanced edit with JSON, as described here:

<https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-user-picker-custom-field>

As the source is a multiple-select field you can iterate over the values for the user add/update.

Kind regards,  
Bill


author: Jenifer Kuntz
body: Ugh, I am back on this and still having issues.

My automation is triggered when the issue is linked with a Polaris link.

My edit issue action that copies some of the standard fields is using Destination Issue and this is working.

So for my my JSON I have this -

{  
"update": {  
"customfield_10195": \[  
{  
"set": { "Id" : "{{destination.Issues.XXX QA Assignee.accountId}}"}  
}  
\]  
}  
}

I originally had it set just to "{{Issues.XXX QA Assignee.accountId}}"

I also tried to to add an issue lookup using this - issue in linkedissues({{issue.key}})

and the JSON

{  
"update": {  
"customfield_10195": \[  
{  
"set": { "Id" : "{{lookupIssues.XXX QA Assignee.accountId}}"}  
}  
\]  
}  
}

All of these show Success but my field is not getting populated. I verified the linked issue does have a user in the XXX QA Assignee field.

Any Ideas?

I appreciate the help!


author: Bill Sheboy
body: Your syntax for setting a single-select user field seems incorrect. Please take a look at the linked documentation for an example.


author: Haddon Fisher
body: I'm not sure off the top of my head what the syntactical difference is, but that would absolutely explain the error message and is more than we've been able to come up with. Will look into it and post my fixed code shortly!

???????????? Thanks [Bill Sheboy](https://community.atlassian.com/t5/user/viewprofilepage/user-id/1685313)!


author: Haddon Fisher
body: Thanks [Bill Sheboy](https://community.atlassian.com/t5/user/viewprofilepage/user-id/1685313) for that extra detail!

I'll pick the work back up next week and either post here or in a new thread, but in case you hit the same issue [Jenifer Kuntz](https://community.atlassian.com/t5/user/viewprofilepage/user-id/527561) (and if you happen to know the solution [Bill Sheboy](https://community.atlassian.com/t5/user/viewprofilepage/user-id/1685313) ?), I ran into some issues doing this. Long story short, we are trying to set a TMP project's user picker custom field (set to allow only a single user) using:

```
{
     "update": {
          "customfield_12345": [{
                    "set": { "id": "111111:11111111-1111-1111-1111-111111111111"}
               }]
     }
}
```

and getting the error:

```
data was not an array (customfield_12345)
```

We've tried pulling the person from a field as well so the ID is not hardcoded, but I think we got the same result.

comments: author: Bill Sheboy
body: You are using the multi-select user syntax in the JSON, but you note the field is configured as single-select. For whatever the field type is, the syntaxes need to match.