Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Extract email addresses from a text field (single line) and add as request participant.

Joël Kemnitzer February 6, 2024

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 (automation)Screenshot 2024-02-06 132542.png(customfield filled with addresses)

Screenshot 2024-02-06 132549.png(addresses should be in "shared with")

1 answer

1 accepted

0 votes
Answer accepted
Rebekka Heilmann _viadee_
Community Champion
February 13, 2024

Hi @Joël Kemnitzer 

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)?

Joël Kemnitzer February 13, 2024

Hello @Rebekka Heilmann _viadee_ ,
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

Rebekka Heilmann _viadee_
Community Champion
February 13, 2024

I see - @Joël Kemnitzer 

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

 

Joël Kemnitzer February 14, 2024

Hello @Rebekka Heilmann _viadee_ ,
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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events