Forums

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

Automation - Ticket to remain 'In Progress' when a draft PR is opened instead of transitioning

Kara Nadarajah
Contributor
September 26, 2023

We have 2 columns on sprint board which are 'In Progress' and 'PR Open'. I have automation setup so that when a PR is opened, the ticket automatically transitions to 'PR Open' status and column.

When a draft PR is open, I want the ticket to remain 'In Progress' but this isn't happening, what am I doing wrong? I thought adding the check on the pull request state would work, but it doesn't. I've tried 'DRAFT' and 'Draft' to identify if it's an issue with the casing but it's not.

I'm trying to work around the lack of functionality which would be fixed by https://jira.atlassian.com/browse/JRACLOUD-72888, which we have been waiting years forScreenshot 2023-09-26 at 08.52.54.pngScreenshot 2023-09-26 at 08.53.12.png

3 answers

1 vote
Kara Nadarajah
Contributor
September 27, 2023

Thanks to the above I have identified a solution which works:

Screenshot 2023-09-27 at 12.42.27.png

Kara Nadarajah
Contributor
September 27, 2023

Hmmm seems to have caused another issue...now when the pull request is transitioned from draft to open, the ticket no longer transitions from 'In Progress' to 'PR Open'...

Henry Yei
Contributor
October 4, 2023

I looked into this, and haven't found an available development variable to check the transition from draft to open (ready to review) state. But your solution is more than half-way there for me!

Like # people like this
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.
September 26, 2023

Hi @Kara Nadarajah 

What if after the trigger, you write to the audit log the value of {{pullRequest.state}} to confirm the value?  That may help you identify what needs to be tested in the condition.

I wonder if that is an enumeration, and there is a lower attribute that could be checked.

Kind regards,
Bill

Kara Nadarajah
Contributor
September 27, 2023

Thanks! I tried that and it looks like the case for 'DRAFT' is actually 'draft' so I've updated my automation rule again and hope this works next time the rule is run.

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

Well done, and thanks for posting that in the open suggestion as well!  That will benefit the community...and perhaps Atlassian will update the documentation to match what you found for the additional value in that field :^)

Kara Nadarajah
Contributor
September 27, 2023

I've had to disable it unfortunately...it's had the unintended consequence of preventing any tickets with a true open PR from transitioning to 'PR Open' status when they are no longer in draft and these tickets are now remaining 'In Progress'.

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

I wonder...

If you map out the flow to confirm the states and your processing timeline, could you capture when draft occurred in the issue (e.g., in a custom field, label, or entity property), and then either modify this rule (or use and additional one) to handle this case.

Kara Nadarajah
Contributor
September 28, 2023

Thanks for your suggestion, I'm not really sure what to do and would rather not have to implement such a workaround for functionality which should be available. I think i'll just have to wait X many more years for https://jira.atlassian.com/browse/JRACLOUD-72888,!!

Like # people like this
0 votes
Bert van Dijk _TMC_nl_
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.
September 26, 2023

Hi @Kara Nadarajah ,

 

What if you use the "Does not contain" option instead of the "does not equal" option in the if statement?

 

Kind regards,

Bert

Kara Nadarajah
Contributor
September 26, 2023

Thanks, I tried but it hasn't worked either. The status has still been updated to PR Open.Screenshot 2023-09-26 at 15.43.18.png

Suggest an answer

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

Atlassian Community Events