Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Need help with smart values match regular expression for email domain name

Hi,

Problem:
I'm trying to get the domain name of the reporter to be set as a label in my issues as they are created. Right now, I have a regular expression working in all of the regex testers online, but when I try it in JIRA it does not work. It returns a blank string or nothing at all.

What I'm looking for is if the reporter's email address is test@mydomain.com, I would like the label to be mydomain


My automation JSON code for updating the label is below:

{
"update": {
"labels": [
{
"add": "{{reporter.emailAddress.match("(?<=@)[^.]+(?=\.)").asJsonString}}"
}
]
}
}

I have tried with asJsonString and without asJsonString. 
I have tried with escape slashes and without slashes

Any help would be appreciated. If not I will use the fall back of 
"add": "{{reporter.emailAddress.substringAfter("@")}}"
which returns the full domain name.

 

Thank you again in advance.

 

2 answers

1 accepted

1 vote
Answer accepted

Hello @mobiusinteractive,

Thank you for reaching out to Atlassian Community!

 We were able to test here and confirm that the smart value that gets only the reporter’s domain is the one below:

{{reporter.emailAddress.substringAfter("@").substringBefore(".")}}

Please, take your time to test and let us know how it goes.

Kind regards,
Angélica

Hi Angelica!

Thank you for this. The only thing I wonder is if an email address is in the form firstname.lastname@domain.com if it will work or not. I think it still will work for this, but not 100% sure.

The final code i put in was this:

 

{
"update": {
"labels": [
{
"add": "{{reporter.emailAddress.substringAfter("@").substringBefore(".")}}"
}
]
}
}

Hi @mobiusinteractive,

I tested here with my email which is name.lastname@company.com and it works, it got only the domain.

Hope this helps!

Awesome! Thank you so much Angelica! You rock! It's working for us thus far.

Like Angélica Luz likes this

HI @mobiusinteractive !

In addition to @Angélica Luz 's Answer, there also another option.

You could use Organizations field, and set it based in the customer's domain:

https://blog.codebarrel.io/set-organization-in-jira-service-desk-using-reporters-email-domain-e705be9d4717

Best Regards

Hi Vando,

Thank you for this, I think this is great as well, but we need it as a label so we can integrate Clockify slightly better into your helpdesk. I think we will use this regardless, but it didn't help the actual need we need for this specific issue.

Thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

ThinkTilt is joining the Atlassian Family!

This morning, Atlassian announced the acquisition of ThinkTilt , the maker of ProForma, a no-code/low code form builder with 700+ customers worldwide. ThinkTilt helps IT empower any team in their or...

923 views 30 33
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you