Extract email addresses from a text field (single line) and add as request participant.
Asked by Jo?l Kemnitzer:

Hello everyone,  
I have already searched through some community posts and unfortunately could not find a solution for my project.

I have the following case:  
In advance - We know that there are assets, for example, and also the function to add users directly when the ticket is created.  
Nevertheless, we would like to stick to the existing process and do the following:  
We have a custom field which is a text field with single line. Email addresses are entered in it. (e.g. "Test.Test@Test.test, abc@def.ghi, 12-34_ab.cd@89x.yz")  
I would like to have these addresses added as request participants via an automation.  
I have already created a rule for testing this.

The rule is structured as follows:  
-Trigger: Scheduled with a JQL query on a single ticket so that the rule can be triggered manually (without having to jump to the ticket each time).  
-This is followed by the first condition that the user-defined field must not be empty.  
-This is followed by a second condition that checks for "{{smart values}} condition". The first value is the custom field "{{issue.customfield_#####}}" with the condition that it contains the RegEx "\\b\[a-zA-Z0-9_.+-\]+@\[a-zA-Z0-9-\]+\\.\[a-zA-Z0-9-.\]+\\b". This is used to check the e-mail addresses (at least that is my assumption).  
Everything has worked so far.

**Now I would like the e-mail addresses entered to be extracted from the field** , saved temporarily if necessary (e.g. in a variable) **and then added as request participants** .  
The additional challenge here is that the users of the e-mail addresses entered usually do not have an Atlassian profile, which is why they would also have to be invited.  

I have the following thoughts on this, which have not worked so far:  
a) Using the "create lookup table" action (<https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-lookup-table>)  
b) Use of the "send web request" action (<https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Send-web-request>)  
c) Using the "edit issue" action with various JSON as an extended option. (<https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/>)

Besides, the artificial intelligence could not really help me either, e.g. to use a script (e.g. in Python).

However, **I would like to solve my problem with the given board means, i.e. automation**

**![Screenshot 2024-02-06 132820.png](https://community.atlassian.com/t5/image/serverpage/image-id/304594i2537D7B641E22D30/image-size/large?v=v2&px=999 "Screenshot 2024-02-06 132820.png")** (automation)**![Screenshot 2024-02-06 132542.png](https://community.atlassian.com/t5/image/serverpage/image-id/304596i1F9E70A0FB04A679/image-size/large?v=v2&px=999 "Screenshot 2024-02-06 132542.png")**(customfield filled with addresses)

**![Screenshot 2024-02-06 132549.png](https://community.atlassian.com/t5/image/serverpage/image-id/304595iBEB70C98686F1E09/image-size/large?v=v2&px=999 "Screenshot 2024-02-06 132549.png")**(addresses should be in "shared with")


Answers:
author: Rebekka Heilmann _viadee_
body: Hi [@Jo?l Kemnitzer](/t5/user/viewprofilepage/user-id/5043960)

are you aware, that Agents can simply add Request Participants directly? No need for Automation or custom fields. Just a thought.

Is your portal open or restricted to Customers (logged in and added to project)?

comments: author: Jo?l Kemnitzer
body: Hello [@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395) ,  
Thank you for your reply.  
The idea, which is probably why the whole thing seems a bit cumbersome, is that an approval process is also linked via the custom field.  
The e-mail addresses entered can be used to decide on the requests later. This is why they also need access to the portal ticket.

Our portal is restricted to customers.  
![Screenshot 2024-02-13 163246.png](https://community.atlassian.com/t5/image/serverpage/image-id/306140i44B6BF9F6E91D9DF/image-size/large?v=v2&px=999 "Screenshot 2024-02-13 163246.png")


author: Rebekka Heilmann _viadee_
body: I see - [@Jo?l Kemnitzer](/t5/user/viewprofilepage/user-id/5043960)

For the field to be used as Approver (if you mean the default "Approval" function in the workflow), you will need a User or Group picker. In your case I guess Multi user Picker is best. The Users will have to be added to your Project (I believe Customer is sufficient) for them to appear in the User picker.

Regardless, you can try to branch over the custom email field by splitting the value at the ,: {{customfield_xxx.**split(",")**}}

The tricky bit is the "they need to be invited" part. Automation cannot edit Users' project roles so I doubt it can create new Accounts. Not tested it though


author: Jo?l Kemnitzer
body: Hello [@Rebekka Heilmann _viadee_](/t5/user/viewprofilepage/user-id/5182395) ,  
No, I have set the condition via the workflow. This means that a decision on two buttons (approve, reject) can only be made by people who are in the custom field. \[I know the default function, but I control it differently, but thanks for the hint (-: \].

I have already tried to work with the split function in a JSON - unfortunately without success.

I think your last thought is the crucial one. For this reason, I will have to go another way, for better or worse. (Probably with a multi-picker field or something similar that handles the creation of new accounts).

Thank you for your input and I hope other community members can find help with my post as well.

**Finally, I accept your given answer with the indication that a different approach will be the solution to the problem.**


Tags: automation

cloud

jira

jira-cloud

jira-service-management

jira-service-management-cloud