Hi all,
how can I use/copy an email address which is mentioned in the description and set it as a request participant via automation?
The e-mail address is written like below.
E-Mail Adresse =...
Thank you for your time and attention,
I do appreciate your feedback.
Kind Regards Mehran
@Bruno Altenhofen wrote a whole article on how to do exactly what you're trying.
Sorry about the earlier journey to get to the exact same place.
Hi @Mehran Ahmadi -
So I think this should work, using the match operator for smart values:
{{issue.description.match(".*E-Mail Adresse =(.+).*")}}
Ah, one catch is that I entered an email address via the GUI, which converted it into a link. So my code above extracts the address as Jira markup for the "link":
[test@notarealemaildomain.com|mailto:test@notarealemaildomain.com]
So I revised the smart value to only parse the text version of the description:
{{issue.description.text.match(".*E-Mail Adresse =(.+).*")}}
And this only returned the email address:
test@notarealemaildomain.com
FYI, for testing this, I used a Manual trigger and used the automation audit log. This is a really powerful way to debug automation rules. There's good details on this here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, because I have a tried lot of add-ons that generated service accounts, I did want to show how you might need to scroll through list of accounts before you can see the Smart Value at the bottom of the list when trying to use it for Request participants.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ugh. Further complications.
I think Request Participants cannot be added by email!
When trying to add an active user by email address, I'm seeing this in my logs:
Inactive user
fb-test@darryl.com
So uh, that's not great. Oooof, of course the estimable @Bill Sheboy has already run into this issue.
So... the big question here is, is the email address in the Description an existing Customer or User, or a new Customer?
If it is a new Customer, then you could possibly follow instructions on that question to create a new Customer, do a couple of Re-fetches, and then grab the Customer accountId to add it as a Request Participant.
Unfortunately probably due to GDPR, I don't think there is a way to lookup the accountId of an existing user or customer by email. Does that sound right to you, Bill?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ugh, I spoke too soon. There is a way with the Find Users API:
https://YOURSITE/rest/api/3/user/search?query=fb-test@darryl.com
So then, this rule got a lot more complicated, because you'll need to use a Web request action to the Jira API to try looking up the email address to see if it has a corresponding accountId, and if so, adding to the issue that using Advanced editing with JSON.
Wait wait! @Bruno Altenhofen wrote a whole article on how to do exactly what you're trying.
Wow, I could've saved myself a lot of time just linking to that!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.