github-for-jira icon indicating copy to clipboard operation
github-for-jira copied to clipboard

Draft pull requests trigger "Pull request created"

Open dpraul opened this issue 5 years ago • 28 comments

I understand that Draft pull requests are a fairly new feature, so maybe it's just that the workflow hasn't been entirely ironed out with how they work with the Jira integration.

That said, opening the discussion: I'm not sure if a draft pull request makes sense to trigger "Pull request created". Right now we use that trigger to transition issues from "In Progress" to "In Review", and I think the intent of a draft pull request is to signal code is still being developed, thus why it also does not trigger CODEOWNERS. I'm also open to suggestions on how to do the transition better if it sounds like I'm in the wrong ballpark.

Thanks!

dpraul avatar Mar 28 '19 14:03 dpraul

Hey @dpraul Thanks for opening this issue! Definitely makes sense to discuss how this should work here. One dependency we have is that the enum for the Pull Request status is this:

https://github.com/integrations/jira/blob/c2b329dd200c3dd348104a16f442602067644fc7/docs/DevInfoAPI.json#L427

It would be great if Jira had a "Draft" state, and maybe we can talk to Atlassian about adding that to their API, but in the mean time, would you rather not have the Pull Request be sent to Jira at all if it's in Draft state? I feel like this could be something people have different opinions on. Personally I would say that creating a Pull Request doesn't necessarily mean it's in review, and maybe you could update the PR title to include the transition syntax when it's really ready for review?

tcbyrd avatar Mar 28 '19 21:03 tcbyrd

I agree with your point on people having differing opinions - I'm not certain leaving draft pull requests out of Jira is the best solution.

Definitely also see your point on a PR opened not necessarily meaning it's in review (my workflow configuration skills are weak, so I'm sure there is room for improvement there). Ideally the workflow would be able to pick up when reviewers are added to a PR and use that to fire the transition, but I haven't had a chance yet to figure out if I can do that given the current tooling or whether that's something that would need to be handled by a different plugin. We're avoiding the smart commit syntax right now in favor of things that work directly with the interface, but that's apt to change if the tools only go so far.

Regardless, if the takeaway here is that draft pull requests function as expected given the current Jira API restrictions then I think that's fine. It was confusing when I originally saw it, but I see how that could also be a result of our non-ideal workflow.

dpraul avatar Mar 29 '19 21:03 dpraul

@tcbyrd what would happen if the status is set to UNKNOWN? Will it prevent the issue from transitioning but at the same time add it to the issue?

Have there been any improvements in JIRA's API to tackle this issue better now?

danielfx90 avatar May 22 '20 06:05 danielfx90

Hi, any update on this issue?

Following up on the conversation, I rather not have the Pull Request be sent to Jira while it is a draft until it becomes ready for review.

ivan-californias avatar Jun 19 '20 20:06 ivan-californias

agree with last comment, is there any update?

joseluiscadena avatar Jun 19 '20 20:06 joseluiscadena

Hi, any updates on this issue?

I also agree with @ivan-californias.

samaronybarros avatar Jul 31 '20 08:07 samaronybarros

Any further feedback on this issue @tcbyrd? I stumbled upon this today and have the same workflow as described by the original author, and am fully on board with the solution proposed by @ivan-californias, what is required to move this forward?

RiaanVR avatar Oct 07 '20 11:10 RiaanVR

Hi there, we also would like to have drafts not to be sent to jira since this is misleading our tracking. A Draft is sometimes kept for multiple days or even weeks and it keeps sticking to a state that implies an active PR.

Looking forward to it!

patrick-tresp avatar Oct 07 '20 12:10 patrick-tresp

Another bump here. Being able to differentiate between draft and final PRs would be awesome for our workflows.

EVNoInc avatar Oct 30 '20 17:10 EVNoInc

This feature should be configurable by the user. I dislike drafts triggering code review. It breaks peers reviewing each others work.

sidhuko avatar Nov 20 '20 17:11 sidhuko

here to chime in and say that i also ran into this issue and it would be amazing if we could get either a different trigger for PRs or possibly a condition where we can check the PR's type

tubbo avatar Dec 15 '20 22:12 tubbo

Any updates here? Would really improve our Jira - Guthub workflow!

matthias-mohemian avatar Dec 18 '20 08:12 matthias-mohemian

Another bump here, any update @tcbyrd ? Any chance this could be reviewed by the Jira team anytime soon? Cheers.

antoine-roam avatar Feb 04 '21 02:02 antoine-roam

It seems that Atlassian has their own ticket about this one. Probably helps more if people go there to vote the issue:

https://jira.atlassian.com/browse/JRACLOUD-72888

trm42 avatar Feb 25 '21 07:02 trm42

Hi @dpraul. I'm from a team at Atlassian that is currently in the process of migrating the ownership over to us from GitHub. As a part of this, we're currently going through the backlog of issues and prs to see what can still be addressed and what should be closed.

I've flagged this with the 'to-triage' label so my team can discuss. We'll keep you posted on the status of this.

rachellerathbone avatar May 17 '21 23:05 rachellerathbone

I would also love to see Draft PRs treated differently for the JIRA integration!

smckinney1 avatar Jul 16 '21 17:07 smckinney1

I would also like to have this feature. We use it to trigger our workflow to move columns and bring work items to people's attention.

brentjensen avatar Oct 07 '21 00:10 brentjensen

Please add this differentiation – this is important to our organization!

ViktorOgnev avatar Oct 07 '21 16:10 ViktorOgnev

Same here, currently In-Review column is flooded with draft pr's which are not ready for review.

Reedyuk avatar Oct 08 '21 11:10 Reedyuk

@tebriel and @rachellerathbone, I think this is a feature our team could benefit from, as well. What things do you need from the community to add this?

There's an implementation mentioned by a member of the community, at https://jira.atlassian.com/browse/JRACLOUD-72888, that would be nice for Atlassian to support natively, especially for developers who don't have admin-level access to our organization's git repository, the Jira workspace, or either.

hamirmahal avatar Jan 18 '22 18:01 hamirmahal

Any news about it?

juniorb2ss avatar Jan 27 '22 20:01 juniorb2ss

Bump!

bbredewold avatar May 27 '22 09:05 bbredewold

Not sure if I should complain to Jira or Github about this, I decided on both. Can we get a solution for this?

lewham avatar Jun 02 '22 16:06 lewham

+1

suhaasprasad avatar Jul 18 '22 13:07 suhaasprasad

+1 from us as well; we'd love for Drafts to not trigger the "Pull Request Created" event

tylertrussell avatar Jul 29 '22 20:07 tylertrussell

Any news?

GalDayan avatar Aug 24 '22 15:08 GalDayan

+1

nickpassarella avatar Sep 07 '22 20:09 nickpassarella

+1

matthias-mohemian avatar Sep 08 '22 08:09 matthias-mohemian

+1

verganis avatar Sep 30 '22 15:09 verganis

To future people popping in here: feel free to comment if you have input! But simply commenting with a "+1" or similar "bump" comments does nothing except create noise for all the subscribers on this thread.

If you'd like to show your support but have nothing to add besides what has already been said, GitHub has a mechanism for your voice to be heard without creating additional noise! Simply leave a 👍 on the top comment and Atlassian will be able to see your input when they sort by "most reactions". 🙂

dpraul avatar Sep 30 '22 15:09 dpraul