Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

I'm trying to setup an automation to check the linked PR status and move the ticket back to the previous status if the PR is in "Draft" status. 

I've found some option in community but seems those are not working. 


I"m using smart value {{pullRequest.title}} and checking if that contains "Draft" and another option is I'm checking if {{pullRequest.state}} equals "Draft" and no success. Audit logs show that the issue didn't match the condition. 

Any ideas?

2 answers

Hey @Bill Sheboy 
Thanks for response. Please see the screens I've attached. The condition simply doesn't catch the issue. 

Tried all possible ways, lower case, upper case etc. 


Also tried this condition  {{pullRequest.title.toLowerCase().indexOf("draft").gt(0)}} which should check the position of the word "draft" in 0 or -1 positions. 

Nothing helps.  


Screenshot 2023-10-25 at 1.42.38 PM.pngScreenshot 2023-10-25 at 1.43.00 PM.png

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.
Oct 24, 2023

Hi @Hasmik Hovhannisyan 

I recall from other, similar posts the state attribute, return value was lowercase (or different than what was shown in the documentation).

Without seeing your entire rule and the audit log, I wonder if that is the cause.  You may confirm this by writing those smart values to the audit log prior to the conditions to learn what they contain.

If that does not help, please post images of your entire rule, the relevant actions / conditions / branches, and the audit log details to provide more context.  Thanks!

Kind regards,
Bill

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.
Oct 25, 2023

Thanks for that information, and please try to keep responses to one thread.  That will help others in the future know if there are multiple solution approaches.  Thanks!

Your rule is triggered on Issue Transition and then trying to access the {{pullRequest}} smart value.  That smart value is only available with the PR-related triggers:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-development/#--Pull-request--

Hey @Bill Sheboy 
seems that doesn't work either. When I set PR creation as a trigger and check whether the status is draft or not automation log shows no matching tasks again.

So is there any other option that can help me?
 

 

Do you know anything about this kind of condition "{{pullRequest.title.toLowerCase().indexOf("draft").gt(0)}}"   ?

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.
Oct 27, 2023

Would you please show your full, current rule and the audit log details showing the execution?

Regarding that smart value expression:

{{pullRequest.title.toLowerCase().indexOf("draft").gt(0)}}

That is doing this...

  • for the PR smart value from the trigger
  • get the title
  • convert it to lower case
  • look for the position of "draft" in that
  • and if the value is found (i.e., greater than 0), return true

That one is using several of the text and math functions for rule: 

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

hey @Bill Sheboy that for the new links I'll be checkin them as well. Meanwhile could you, please, check what is wrong with this one?
Screenshot 2023-10-31 at 7.24.48 PM.png

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.
Oct 31, 2023

Hi @Hasmik Hovhannisyan 

What is not working as you expected?

And...please add a write to the audit log after the trigger, including {{pullRequest.state}} as that may reveal if there is a mismatch with your condition test.

Please post an image to the audit log details as that will provide some context for the rule execution.

Suggest an answer

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

Atlassian Community Events