Forums

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

Jira automation create a task and assign it to a member of a group - JQL issues

janez_m
Contributor
July 15, 2021

I really like the Automation for Jira plugin, but this one is a hard nut to crack. 

We wanted to update our automation rules for recurring tasks that occur every month with a group of assignees - we just added a new action to assign the new task to one assignee from the group, but the rule does not want to be executed anymore - in the option for "When rule executes..." we had selected "simply run the conditions and actions without providing issues" that is not compatible with the last action to assign the task to the group members - and the error is: 

  • The rule has been configured with components that require issues to be provided by the trigger. You need to use the option to run JQL to provide issues. The following components require issues: Assign issue

I understand we have to use the "run a JQL search and pass results to subsequent conditions and actions" and I've tried to design one that targets only the newly created scheduled task, but I am failing to come up with a proper JQL.

The result is that JQL statements, I've tried to use, produce hundreds of new tasks as I cannot limit the JQL statement to only one match - the one we want to create. I've tried smart values with dates and other tricks I can think of, googled the issue, but no luck.

 

Does anybody know how to craft a JQL statement that will target only the one task that is being created - or is it impossible, as the task is not created yet in that stage?

 

This is how the non-working rule is looking now:

Screenshot 2021-07-15 at 11.20.21.png

2 answers

0 votes
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

Hi @janez_m 

Is your rule trying to do the following:

  • trigger: scheduled rule running JQL to gather some issues
  • action: create issue (I am assuming using some data from the each issue found by the trigger, one by one
  • action:  assign the newly created issue round-robin

If so, and the challenge is selecting the newly created issue, you could branch on {{createdIssue}} to assign it.  Please look here for more information about that smart value.

 

Best regards,
Bill

janez_m
Contributor
July 16, 2021

Hi @Bill Sheboy 

Thank you for the answer. The aim of the rule is to open a new task every month and assign it to a different member of the group.

I think I've come up with a possible solution after being away for a while. I will break the rule into two parts:

- First I will create a new unassigned task with a special label (this step I have already implemented, I will just remove the "hard-coded" part about assigning the task)

- Second I will create a new rule that will run every 10 minutes or so and check all the tasks in our project that are unassigned and have the special label - when it will find it it will assign it to one of the members of the group.

 

Thank you again for your reply and best regards to you too,

Janez

Like Bill Sheboy likes this
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 16, 2021

Thanks, Janez. 

To help my understanding, what is not working/happening when you do this in one rule?  I believe using {{createdIssue}} should work, and if there are multiple issues you could instead use {{createdIssues}} (note the plural) with a branch.

0 votes
janez_m
Contributor
July 15, 2021

P.S. I've also tried with a new condition after the first step, but I have the same issue how to create only one task as all the conditions I could think of produce more than one result..

Suggest an answer

Log in or Sign up to answer