Automation to fill in resources etc
Asked by Phillip Jones:

So we are probably using JPD in the wrong way, but since plans doesn't support multiuser pickers (for some reason), I'm trying to get our project valuation list into JPD so my leadership stops using an excel sheet.  
I have JPD setup very nicely right now and I'm hoping I can put a bow on it with some automations and one of the biggest automation requests is to automatically pull the users from linked issues (an epic or initiative etc) and take the users listed under additional participants and them pipe them to JPD and add them to the resources field.   

However, I'm running into not being able to find that field in automations.   

Does anyone know if there is a way around this? If I had a custom field ID this would be about as standard as ever but I'm not sure how or where the "fields" in JPD are store and how to reference them. I'm willing to do API calls if needed as well but unsure of how I may even be able to do that.  

EDIT: Just to update, I ran a get on the issue from JPD and was able to find the custom field value, it just looks like I'll have to configure the advanced field editing. If anyone has any advice for that too, I'm all open. Right now I have to play this game of cat and mouse on how to trigger it properly and then not getting a correct JSON unfortunately.


Answers:
author: Nick H
body: Hi [@Phillip Jones](/t5/user/viewprofilepage/user-id/5193482) ,

What [@Gary Spross](/t5/user/viewprofilepage/user-id/5166286) shared should help. You can use an automation / JSON body like in that post, or below to map Jira delivery people-fields to JPD idea people-fields:

![auto23.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/340099i21214D0B1675F8E8/image-size/large?v=v2&px=999 "auto23.jpeg")

```
{
"fields": {
"customfield_JPD": [ { "accountId": "{{triggerIssue.customfield_JIRA.accountId}}" } ]
}
}
```

\^ Having said that, this has only been able to work as expected mapping a Jira people-field to a JPD people-field when **one** user is selected.

I have not been able to get this working with a multiple user picker field / multiple users configured in the Jira field. I'll continue testing and hopefully will have something soon.

comments: author: Phillip Jones
body: Thank you for the help! I've gotten this far for sure and the logs are showing IDs, it also shows as a successful run but I've noticed 2 things.   

1. Even though a success, it doesn't actually add them (I'm testing with a ticket with 2 users because many have more than 1.  

2. This is the more concerning one, I am noticing, if I change the ticket in the "Linked Ticket" field in JPD (which is what I have the trigger set to) it keeps pulling the info from another ticket. I'm using the

```
{{triggerIssue.customfield_JIRA.accountId}}
```

smart value that you suggested but it was happening before as well when I was using  
{{issue.issuelinks.inwardIssue.customfield_XXXXX}}  

Not sure why it's not picking the right ticket for the IDs. That's also secondary to it not actually setting them as well.


author: Gary Spross
body: [@Phillip Jones](/t5/user/viewprofilepage/user-id/5193482), the answer to this question may help guide you.

<https://community.atlassian.com/t5/Jira-Product-Discovery-questions/Copy-value-of-the-reporter-creator-field-into-a-custom-people/qaq-p/2726412>

comments: author: Phillip Jones
body: Yes, I've gotten pretty far right now but running into a weird error.  

I think my logic might be wrong? The logs show the IDs correctly so it's seeing them it's just failing to add them for some reason.

Now I'm seeing in the logs "Pick another user as the selected user doesn't exist."  
![JPD Automation issue 1.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/340098i643B229C9E957FAA/image-size/large?v=v2&px=999 "JPD Automation issue 1.PNG")  
![JPD Automation issue 2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/340096i02572FCD64A00ADE/image-size/large?v=v2&px=999 "JPD Automation issue 2.PNG")  


Tags: jira-cloud

jira-product-discovery