Forums

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

How to check the particular item from checklist field using Jira automation

Pallavi Deore October 30, 2023

Hello Everyone,

I am working on Jira.

I need some automation where on certain condition Jira automation rule will check some specific item of checklist field. Is it possible and if yes can you please give example of that.

Regards

Pallavi Deore

2 answers

0 votes
Maxime Lefebvre _Okapya_
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.
October 31, 2023

Hi @Pallavi Deore

If you are using Checklist for Jira, then take a look at the following resources:

I would direct your attention to the Updating existing items example.

Kind regards,
Maxime

Pallavi Deore October 31, 2023

Hello @Maxime Lefebvre _Okapya_ ,

In my case, When Story move to Close state then issue which have this story key in the checklist item that should be checked.

So I use the trigger as transition issue to Close and created smart value variable for trigger issue key and then I use the Branch rule / related issues as the checklist is smart value and then use below json in additional field:

{
"update": {
"Checklist": [
{
"edit": [
{{#Checklist}}
{
"name": {{name}}
{{#if(equals(#name, #issuekey))}},
"id": {{id}},
"checked": true
{{/}}
}
{{^last}},{{/}}
{{/}}
]
}
]
}
}

Getting error " Error while parsing additional fields. Not valid JSON."

So In that issuekey is my smartvalue which is actually trigger issue key.

Can you suggest me what exactly is wrong in this.

Maxime Lefebvre _Okapya_
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.
November 1, 2023

Hi @Pallavi Deore

Here's how I would do it, (but I unfortunately don't think this can work):

{{#Checklist}}
{
"id": {{id}}
{{#if(equals(name, issuekey))}},
"checked": true
{{/}}
}
{{^last}},{{/}}
{{/}}

The reason I don't think this can work is because you cannot access smart value variables from outside the loop while inside the loop. You have access to the item's variables like namestatusIdchecked etc. but you can't access and compare issueKey.

Try it out and maybe you'll show me wrong, but I think you would be better off using groovy scripts at this point.

Kind regards,
Maxime

0 votes
Wojciech Wardaszko
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.
October 31, 2023

Hi @Pallavi Deore

Please share what is the app used to provide Checklist functionality on your server - the answer depends on that.

Cheers!

Pallavi Deore October 31, 2023

I am using Checklist add on.

Pallavi Deore October 31, 2023

With automation rule I need to edit checklist items. so I use "Edit Checklist items" action then I selected that field which I wanted to update but the problem is how to use "Item Filters". I have filter out checklist items with item name which I have in smart value eg: test but If I directly use that {{test}} in value it didn't work.

I know that we have to specify the regular expression. In my case I have to use issuekey in that.

Any suggestion.

Wojciech Wardaszko
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.
October 31, 2023

Checklist Add-on is actually Checklist for Jira, so you're best off following @Maxime Lefebvre _Okapya_'s lead in this case :)

Cheers!

Maxime Lefebvre _Okapya_
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.
October 31, 2023

@Pallavi Deore

We do not support smart values inside filters at the moment.

Could you please explain what exactly you are trying to achieve? I might be able to help with it.

Pallavi Deore October 31, 2023

Hello @Maxime Lefebvre _Okapya_ ,

I added comment above.

please check.

Pallavi Deore November 1, 2023

Could you please suggest where I made mistake.

Suggest an answer

Log in or Sign up to answer