Automation: notify after every 20th task creation

Ketevan June 6, 2022

Hello.

Can I create an automation rule that notifies me after every 20th task is created?

Or if there is any plugin that can help?

 

Thank you

3 answers

5 votes
David Freitez
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.
June 6, 2022

Hi Ketevan,

 

This could be achieved also with Automation, I am sending an example to notify when the mark of issues is hit.

What I do in the script is: 

  • Extract the number from the Issue key that was just created and added into a smartvalue.
  • Divide the extracted issue key using the MOD function which returns the spare of a division, giving as a result 0 if the issue can be exactly divided by 5, in your case is 20.
  • If the result of the MOD division is 0, then send the notification.

Here are images of explaining the automation rule.

Indeed this problem could be solved with ScriptRunner as well, but that would require buying a plugin a probably more programming than it needs to be.

Hopefully this can help you and you can mark it is an answer.

If you have any questions, just let me know.

Regards,
David

 

image.pngimage.pngimage.pngimage.png

Andrea Pannitti
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.
June 6, 2022

Hi @David Freitez ,

just a thing about your solution: in it the Task number is recovered from the issue key and not through a JQL but so, if some task has been deleted, this solution no longer works correctly.

Like Ketevan likes this
David Freitez
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.
June 6, 2022

Hi @Andrea Pannitti ,

You are right, I'll update it.

Thanks.

David Freitez
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.
June 6, 2022

Hi @Ketevan

As was pointed out, we cannot rely on extracting issue key number to check on how many issues has been created if there are issues that were deleted. So, in that particular case:

I have updated the rule so it uses the Lookup Issues feature that uses a JQL that gives as result all issues of the project, then we'll grab with the smartvalue the result amount of the query and that's the value we'll end up dividing using the MOD function, the rest of the rule is the same.

If you have any questions regarding the implementation, just let me know.

Regards,
David

 

image.png

Like Ketevan likes this
Andrea Pannitti
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.
June 6, 2022

Hi @David Freitez 

I think the correct JQL should be this:

project = PN1 and issuetype = Task
David Freitez
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.
June 6, 2022

Hi @Andrea Pannitti

Actually, the JQL is an example in my sandbox,  the JQL needs to be updated according to the needs of the person that would apply this solution.

I see the ticket creator indicated task, but it could have meant a task-like issue type.

Anyway, thanks for pointing it out,  this is my first Atlassian community reply, so you are right, it's all about details.

Thanks,
David

Like Ketevan likes this
Andrea Pannitti
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.
June 6, 2022

No problem @David Freitez  and thank you for your contribution!

Like David Freitez likes this
Ketevan June 7, 2022

Hello guys,

Many thanks for helping.

@David Freitez I've tried everything according to your screens, but when I run the rule it fails, here is the log:


Screenshot 2022-06-07 at 15.52.55.png

Do you know how to solve this?

David Freitez
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.
June 7, 2022

Hi @Ketevan

Are you using the rule with the JQL or extracting the number from the Issue key ?

Can you share the screenshot of the % operator being used ?

Thanks,
David

1 vote
Andrea Pannitti
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.
June 6, 2022

Hi @Ketevan ,

this surely can be done with ScriptRunner!
With a post-function on Task create, a JQL get the number of Task and if this is divisible by 20, a notification is send.

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.
June 6, 2022

Hi @Ketevan 

What problem are you trying to solve by doing this?  Knowing that may help the community to offer suggestions.  Thanks!

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events