github-for-jira
github-for-jira copied to clipboard
PR status is not propagating correctly with closed draft PRs
We use a 3rd party merge queueing system that will create a draft PR (which is never upgraded into an open PR) that batches multiple change sets together for CI evaluation. This draft PR contains the commit with the Issue-ID
prefix and is linked to the PR. The PR creation and merge commit actions are performed via an internal automation user and when that users closes the PR the state doesn't transition from Open
in Jira to Closed
or Declined
. The PR never enters the "open" PR state.
Am I correct in assuming that if a PR is closed it would show up as Declined
in Jira?
This is blocking automation around closing issues as the development[pullrequests].open = 0
evaluates to false.
-
Is this a bug that draft PR state doesn't propagate correctly into Jira?
-
~~Is this a case of https://github.com/atlassian/github-for-jira/blob/main/SUPPORT.md#workflow-transitions-are-not-running. I briefly looked into this but the patch files for the merge commits are on behalf of the user (who has Jira permissions) and not the automation user. Pr creation is done by the automation user though. It would be strange to me that the creation event would get picked up but then the transition from
Open
toDeclined
.~~. I tested this theory and disproved it. -
Is there a way to bypass this bug and target my automation around a single closed Pull Request?
development[pullrequests].merged = 1
(this is invalid jql)... I am having trouble finding documentation around the schema for this field.
Found info related to #3 here https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-developer-status/. Doesn't seem like there is any way to target a single closed PR with jql syntax.
For clarity, the PR is always in a draft state and never upgraded to an open PR status?
@mboudreau Yes
Any thoughts here?
@mboudreau do you need something else from me or can we remove the "awaiting-response" and "question" label?
I confirmed that #2 is not an issue.
If I can get some help triaging this issue I'd be happy to fix it
I would also be willing to contribute to this, if we could get a nudge in the right direction.
Hey @sholsapp and @michaellarocca90. We'd be happy for one of you to tackle this one. What do you mean by a nudge in the right direction?
@rachellerathbone what I meant was maybe a pointer to where in the code the maintainers would start. I've never worked on this codebase before so don't know what important objects, architecture patterns, gotchas, etc., exist. If there's an obvious starting point, that'd be great. 😄
Ping! Friendly reminder we'd be willing to contribute a fix if you can give us a high level sense of where to start looking.
Important fix for us @rachellerathbone could we get a little help?
Hey all. We had someone on our team do some investigatory work on this one. Unfortunately, it looks like it would require changes in several locations (so not solely the GitHub for Jira integration) so this would need to be picked up by an Atlassian employee. I have created a ticket in our backlog.
@rachellerathbone was something done here? I believe I'm seeing a change on our end that the draft PR's are getting marked as Declined
and the Issue is accurately reporting Merged
on the PR.
Actually, it seems like it's not fixed. It was for a brief period reporting Declined
, now we are back to Open
Hi @rachellerathbone , just curious where this issue sits on the roadmap. We're still needing to manually close all our tickets due to this issue
Hi @rachellerathbone, we recently saw ticket begin to autoclose again and wanted to check and see if you fixed something on your end.