Forums

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

Automation: targeting by JQL the same user as in a triggered rule

Alexey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2021

Greetings, I'm trying to create simple automation to pull out all tasks of a person from one status to another when someone moving in a new task to that status.

Goal to ensure that each person couldn't have more than 1 task at the same time in that particular status.

Currently, I've managed to create a rule which pushes away all tasks in that status, now I need somehow to capture the 'assignee' field from the trigger issue and via JQL search for his/her tasks and move them (or any other way, which helps me reach the goal).

Project automation - Jira - Mozilla Firefox 2021-0 (5).png

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2021

Hi @Alexey 

First thing: I wonder if you are solving a symptom or a root cause of the problem, which appears to be people are not finishing work before starting more work, leading to higher work in progress (WIP).  Solving the symptom using Jira automation may lead to unintended consequences: such as people not assigning work or moving it when active.

For your question, have you looked at {{triggerIssue.assignee}} as a field to use for queries?

Best regards,
Bill

Alexey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2021

Thanks, @Bill Sheboy there are a couple of scenarios of why this happens but at the end of the day, it's all about transparency. We need to see what people are doing, to make decisions. As a team, we decided to test such automatic assistance and see how it goes.

Back to the topic, as I know JQL does not accept smart values, hence I don't know a way to add {{triggerIssue.assignee}} to the query.

In my understanding, I need to compare {{triggerIssue.assignee}} with JQL results and at this moment, I do not know how to do that!

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2021

Inside of an automation rule, you can use smart values in JQL.  For example, you can branch or do a Lookup Issues on:

assignee = {{triggerIssue.assignee}}

You cannot test it with "verify" when writing the rule, as the smart value isn't populated yet.  Instead you would need to run the rule to confirm your results.

Like Alexey likes this
Alexey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2021

@Bill SheboyThanks a lot, i wasn't aware of the ability to use smart values in JQL within automation rules! Learning new every day hehe, it works, perfectly.

Maybe it's not the most elegant way to handle WIP, but we need time to adjust our processes and this is what everyone has been asking.
I added an exception for unassigned tasks, but we cant have such issues at that stage.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer