Automation to copy User Field from PD to JSW

Jenifer Kuntz
Contributor
October 11, 2023

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!

 

 

3 answers

1 accepted

2 votes
Answer accepted
Haddon Fisher
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.
October 11, 2023

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 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. 

Jenifer Kuntz
Contributor
October 11, 2023

Yes, that is exactly what I am doing. I appreciate your help.

Like Haddon Fisher likes this
Bill Sheboy
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.
October 11, 2023

Hi @Jenifer Kuntz and @Haddon Fisher 

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

Jenifer Kuntz
Contributor
October 18, 2023

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!

Bill Sheboy
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.
October 19, 2023

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

Like Steffen Opel _Utoolity_ likes this
0 votes
Haddon Fisher
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.
October 11, 2023

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!

0 votes
Haddon Fisher
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.
October 11, 2023

Thanks Bill Sheboy 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 (and if you happen to know the solution Bill Sheboy 😁), 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.

Bill Sheboy
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.
October 11, 2023

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.

Like Haddon Fisher likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events