Edit Request Participant field with Asset values
Asked by Mario GELES:

Hi community,

I want to edit the field Request Participant with some values from Asset.

I have done a lookupObjects and insert the values in a variable.

The values are the Name Attribute (called "Nom") of the object witch is in "Users" objectType.

This attribute type is "Text" and not "User".

The Audit log action confirms that values are correct (First name and last name).

The rule status is succed.

However the Request Particpant field is still empty.

![Request_Particpant_Automation.png](/t5/image/serverpage/image-id/318836iE764330EF343DAF7/image-size/large?v=v2&px=999 "Request_Particpant_Automation.png")

![Request_Participant_variable.png](/t5/image/serverpage/image-id/318837i27FD7AD7BA15E3E0/image-size/large?v=v2&px=999 "Request_Participant_variable.png")

![Request_Participant_edit.png](/t5/image/serverpage/image-id/318838i957EF2A984C3824F/image-size/large?v=v2&px=999 "Request_Participant_edit.png")

I tried with an attribute of type "User" and it doesn't work either.

I checked the "Request Participant" field with a copy paste of the values and the user is found. but I noticed that in order to update the field I have to click on the user otherwise the field stay empty. Maybe that's the problem with my automation.   

Could someone help me with this ?


Answers:
author: Mario GELES
body: I've found the solution (Indeed the name attribute was not good but the email attribute works) :

![Request_Participant_Solution.png](https://community.atlassian.com/t5/image/serverpage/image-id/319260i8AAFC0B57858EEA8/image-size/large?v=v2&px=999 "Request_Participant_Solution.png")

Juste after the lookupObject where there is the AQL to find data in Asset, I made an advanced branch.   
The smart value is {{#lookupObjects.distinct}}{{write here the name of the mail attribute}}{{/}}  
{{#lookupObjects}}{{/}} allow to use a list of datas from asset

.distinct allow to split data in different values

Then edit issue standard mode (not JSON) and use the variable + this smartvalue {{issue.Request Participants}} in order to keep values existing in the Request participant field.

Then re-fetch data

Then edit issue again standard mode and use the variable + the smartvalue {{issue.Request Participants}}


author: Mario GELES
body: I tried to edit "Request Participants" in the custom way using JSON instead of the standard way.

![Request_Participant_JSON1.png](https://community.atlassian.com/t5/image/serverpage/image-id/318853iECE0BF71249BFDFF/image-size/large?v=v2&px=999 "Request_Participant_JSON1.png")

I tried this JSON for a list of one user :

{  
"update": {  
"Request participants" : \[  
{  
"add": {  
"name":"{{Participants}}"  
}  
}  
\]  
}  
}

The status rule is succeed, the rule's audit log says that the field had been edited but in my issue the field appears empty.   
Of course the field is in my edit and view screens.

comments: author: Ben Alderton
body: Hello Mario,

I would recommend the value of a Jira account id or a customer email address using the "id" field. I was unable to get "name" to work.  

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/318883i8774C93484FD1ECB/image-size/large?v=v2&px=999 "image.png")  
You may need to add a "Re-Fetch" component after creating the variable to ensure the edit component isn't pulling a null value from {{Participants}}.  

I was unable to modify the request participants with update, but I was able to do it with "fields"(set)  

<br />

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/318884iD42D9FEC71841BA3/image-size/large?v=v2&px=999 "image.png")  

This can be accomplished with a lookup table too, or multiple values.  

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/318894i4652E77018841E10/image-size/large?v=v2&px=999 "image.png")  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/318895i23278DA3F36F2358/image-size/large?v=v2&px=999 "image.png")


author: Mario GELES
body: Hi Ben,

I don't understand what is the "id" field you are speaking of.

Since Jira and Asset don't use the same Id's

The table idea seems great but I don't know how to split my datas wich are in a variable in the different lines of the table.


author: Ben Alderton
body: Hello Mario.

My understanding of the "request participants" field is that it requires an accountID/username to be set in automation. If your {{Participants}} value is "FirstName LastName", then the automation is unable to match that to an account id. If the participants are portal-only customers, I believe you should be able to set them using their username/email address. If they are a service desk customer, you will need to locate their account ID within Jira.


Tags: cloud

jira-service-management

jira-service-management-cloud