Check Jira Issue in Branch Name

Issue #105 resolved
Curtis created an issue

Jira allows the creation of branches easily from the Jira issue. The default branch name filled in has the Jira issue in it. I think that Jira issue should be validated, just like in commits, so it can be rejected if that Jira issue doesn’t exist, or is in any specified statuses, like Canceled or Done.

Comments (7)

  1. Puddleglum

    Hi Curtis, I think you can enforce this with Control Freak’s settings…. at least I did so successfully.

  2. Curtis reporter

    You can set Control Freak to require a Jira Issue in the branch name, but that Jira Issue could be closed or cancelled. It doesn’t use or have it’s own configurations to customize what are acceptable Jira Issue statuses or Projects.

  3. Curtis reporter

    I don’t think you can, if I am understanding your statement correctly.

    I have enabled to force a new branch names to contain a Jira Issue. The Jira Policy shows as active and is enabled for feature branches, must exist in Jira, and must have valid status. Done is in the list of invalid statuses, but yet I am able to create a new branch successfully, with a Jira ticket that is in the status of Done.

  4. Julius Davies [bit-booster.com] repo owner

    This is a fair request. Curtis is referring to the “New Branch Names Must Match” control. I’m not even sure if it checks that the Jira ticket exists, and it definitely doesn’t check ticket status at this time.

    Here’s what we plan to do:

    New Branch Names Must Match:

    • [x] - Repository's Branching Model
    • [x] - Any Jira-Like Key [EXCEPT FOR RELEASE BRANCHES]
    • [x] - Valid Jira Ticket [EXCEPT FOR RELEASE BRANCHES] (uses same validity checks as Jira policy, below)
    • [x] - Regex: [ ]

    Would that work for you, Curtis?

    Note: the “Be assigned (in Jira) to the commit author” validity check would have to be ignored here, since it doesn’t make sense for a brand new branch.

  5. Curtis reporter

    Yes, that should cover the basics so that branches are only created against existing and valid status Jira issues.

    Thanks!

  6. Log in to comment