Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation - JQL Query not populating email

Alex M July 28, 2022

Hi! I have scoured the internet for a fix to this.

I am using Jira Automate to populate an email with contents from a JQL Query, that returns all the issues that are basically not completed.

The query works perfectly when interrogating in the Advanced Issue Search but does not populate the email.

-----------------

(assignee = currentUser()) AND ("status" = "To Do" OR status = "In Progress" OR status = "Waiting for response" OR status = "In QA" OR status = "Blocked")

------------------

 

 

When I try this one it works perfectly with my automation rule and populates the email perfectly.

--------------------------

((assignee = thisismyuserid12345678) AND ("status" = "To Do" OR status = "In Progress" OR status = "Waiting for response" OR status = "In QA" OR status = "Blocked"))

-----------------------------

 

So I know it is something to do with the currentUser value .

Both rules return the exact same issues / number of issues - the bottom one is the only one that successfully populates the email with the contents I need.

 

Any ideas?

 

Thanks :)

 

 

 

 

 

1 answer

0 votes
John Funk
Community Champion
July 28, 2022

Hi Alex - Welcome to the Atlassian Community!

What is the trigger that causes the automation rule to fire?  And who is the rule run as? 

Alex M July 28, 2022

Thank you John!

The trigger is a manual trigger for all users who are logged in.

The rule works perfectly when this is used:

((assignee = thisismyuserid12345678) AND ("status" = "To Do" OR status = "In Progress" OR status = "Waiting for response" OR status = "In QA" OR status = "Blocked"))

 

but returns no values in the email when this is used:

(assignee = currentUser()) AND ("status" = "To Do" OR status = "In Progress" OR status = "Waiting for response" OR status = "In QA" OR status = "Blocked")

John Funk
Community Champion
July 28, 2022

Yeah, I think it is getting confused as to who the actual user is when the rule is fired, meaning the Actor. So even if Alex fires the manual trigger, it might run as the Actor of Automation for Jira. Does that make sense? 

Alex M July 28, 2022

Thanks John -- do you know a workaround for this, so that when one of my teams manually triggers this rule, it will run that JQL search and look for all issues assigned to whoever ran the rule?

Potentially a userid equivalent for  assignee = currentUser()?

 

Thanks for taking the time out to help on this one. I feel like there is a solution staring me in the face but as I've been trying to solve this for so long, I'm getting nowhere.

John Funk
Community Champion
July 28, 2022

I don't know of a way to do that right off the top of my head. Other than hard coding the assignee like you have it and create a separate rule for each person. How many people are there? 

Alex M July 28, 2022

Ah, minimum 30 people. And I'd like it to be triggered manually from the rule exception drop down so whoever triggers the automation runs the JQL applicable to themselves

John Funk
Community Champion
July 28, 2022

Does it have to run manually right then? What about a scheduled email once a day or more?

Alex M July 28, 2022

Hey John,

 

Yes it would need to be a manual thing because not everyone would need / want to do it.

And for context, It'll be a JQL statement that looks up a load of issues and edits them (changes sprint, updates fields etc) when triggered - but only the issues based on who triggered the rule. Hence the above JQL.

John Funk
Community Champion
July 31, 2022

Well, I am baffled as to how you will be able to do this with a generic script and not one for each person. 

Suggest an answer

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

Atlassian Community Events