You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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?
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)}}" ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
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/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.