How do I auto assign tickets to Teams, based on an e-mail domain in description field

Michael Krarup Stefansen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 14, 2025

We have a setup where customer e-mails are send to a shared mailbox and from that mailbox, e-mails that require a ticket to be created are forwarded to the Jira Service Management solution.

These e-mails has the person forwarding it in the requester field, but we need to assign it to the customer responsible team, which is based on the customer e-mail domain.

How do I pull out that customer e-mail domain from the Description field and automate the assignment to the responsible team?

1 answer

1 accepted

1 vote
Answer accepted
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 14, 2025

Hi @Michael Krarup Stefansen 

Pulling out the customer email domain from the Description field is easy but it may also come with other problems, e.g. if there are multiple emails in the description field, etc.

I'd suggest

- create a custom field to store the domain (say it is Domain: customfield_12345)

- then create an Automation rule and set the trigger (e.g. Issue Created)

- add an action to extract the email domain with a regular expression something like the below

{
"fields": {
"customfield_12345": "{{issue.description.match("(?<=@)[a-zA-Z0-9.-]+")}}"
}
}

- add an action to assign to the team (you can use the Domain custom field or the regular expression directly here)

On the other hand, there is the free app, SnapAssign on the Markeplace which you can use to offload some of the burden. I am one of the folks behind, if you have any questions please do ask, I will gladly answer.

Michael Krarup Stefansen
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 14, 2025

Hi @Tuncay Senturk 

Thank you very much for your answer, it's highly appreciated.

I might be a bit too much of a new-be to this, but I can't really get the above suggestion to work.

I have created the customfield called "Customer", where I wish to find the customer e-mail in ticket, that has been assigned by forwarding a mail from shared mailbox to the Jira Service project.

It seems that the customer e-mails are incapsulated in <> in the Description field.

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2025

Let me try to boil it down. My solution requires using Automation.

- Create an Automation rule (Project settings > Automation > Create Rule)

- Choose Issue Created as the trigger

- Add a branch/action and choose edit issue fields > more options (advanced json)

use the json I provided  replacing the 12345 with your Customer custom field.

{
"fields": {
"customfield_12345": "{{issue.description.match("(?<=@)[a-zA-Z0-9.-]+")}}"
}
}

- add if/else block

 

Condition: Compare the extracted email domain. Use Advanced Compare Condition:

  • First Value: {{issue.description.match("(?<=@)[a-zA-Z0-9.-]+")}}
  • Condition: Equals
  • Value: customer1.com (replace with the actual domain you want to compare).
    • Action: Assign the issue.

And repeat for Other Domains adding additional "Else If" branches for each customer email domain and assign to the corresponding team.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events