Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automatically change issue type based on email "to" field

Phillip C March 25, 2021

Hi,

(TLDR below)

Basically, I've got an email account connected to Jira that has multiple aliases on the mailbox and I want to be able to automatically change the issue type based on the email 'to' field.

Use case:

Emails that are sent to spamreporting@mydomain.com, will be changed from the default placement of service request TO spam reporting (a custom issue type i created)

FYI I already matched my source to destination workflow - so thats all good there. 

After much investigating I finally found how to add logging, validate json and get my email "to" field. Wow! (im pretty new to this so give me a moment here).

However, now I've changed the rule from manually trigger to Issue Created - it doesnt trigger. So I've tested a few different triggers, but no luck either. I thought about a time condition, but I don't really want to put in a run every 10 seconds / 30 mins / 1 hour type of trigger either - thats just barbaric.

Any ideas on what trigger i need to put in OR if there is just a way simpler method that what im trying to achieve?

 

TL;DR - why is my compare statement only working by manually triggering the automation rule and not for Issue Created?

 

image.png

3 answers

1 accepted

2 votes
Answer accepted
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 31, 2021

Hello @Phillip C,

Thank you for reaching out to Atlassian Community!

Checking your use case, it seems that the email information is taking a while to be populated, that’s why when using the “Issue created” trigger is not working.

What I’m trying to say is that, when the issue is created, the field is yet not populated, so the automation runs when it’s still empty. Using Manual trigger works because it takes a while until you open the ticket and click to run the automation.

You can try adding an action called “Re-fetch issue data” before adding the condition to try to slow down a little bit the automation. I don’t have any email and aliases to test the same scenario as you, so please, take your time to test and let us know how it goes.

Screen Shot 2021-03-31 at 10.21.27.png

Kind regards,
Angélica

Phillip C March 31, 2021

Yes! This is exactly what i needed in the automation. I thought the field was still being updated and thus not triggering, excellent action to use! That resolved the issue, thanks you so much!

Like Angélica Luz likes this
1 vote
John
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 29, 2021

Hi @Phillip C 

You mentioned the rule isn't triggering, is it not triggering at all or is the condition not being passed?

If the condition isn't being passed could you put a log action before the condition and just check your smart value (and make sure it's set). Hopefully I can help you more form there.

Another thing worth noting is you can't edit the issue type for Jira Service Management tickets. We have an open public ticket for this https://codebarrel.atlassian.net/browse/AUT-1750

You could clone the request and change the type, then close or delete the old ticket.

Thanks,

John

Phillip C March 31, 2021

thanks for the reply John. The rule is triggering, just the condition wasn't matching. The reply from @Angélica Luz with the re-fetch action placed in my rule after the the 'issue created' trigger is perfect.

Like Angélica Luz likes this
0 votes
Hector Vazquez March 22, 2023

Hi @Phillip C

How did you get the "to" email address? Once the issue is created, I only see the subject (summary), the reporter and the email body in the description.

I have a Jira project and 3 email handlers that create issues (tasks). I want to set a component (or update a custom field) based on the email address that receives the email. 

Hope you can give some insights, thanks!

Greg Shub May 10, 2023

would love to know this as well.

Hector Vazquez May 10, 2023

Hi @Greg Shub

Couldn't find a direct way to do it, so I created a "buffer" project for each email address where I receive the issues and "pre-process" them using automation (creating a new issue in the destination project setting component, team, etc.) 

Suggest an answer

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

Atlassian Community Events