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.
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(".")}}"
}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tested here with my email which is name.lastname@company.com and it works, it got only the domain.
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome! Thank you so much Angelica! You rock! It's working for us thus far.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Best Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
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.