16

We are using Jira 6.4.1 connected to Bit bucket 4.3.2. When i look at the releases for my project i see a number of warnings for some specific Jiras. The warning is:

Unreviewed Code These issues have been marked complete but the commits are not part of a pull request or review.

Usually as my workflow i may push commits direct to the repo without code review; but the issues listed seem a bit random and i can workout whats been done with them.

What causes this state and warning, and how can i resolve it?

philant
  • 34,748
  • 11
  • 69
  • 112
Tim
  • 3,576
  • 6
  • 44
  • 58
  • Very random warnings indeed. I couldn't figure out either why out of hundreds commits, only two were marked by this warning. – Boaz Nov 08 '16 at 13:13

2 Answers2

13

This warning is caused by having a jira issue key used in commits, but that issue key not appearing in a pull request or review. The assumption is made that all code included in that release should be reviewed.

There are two ways to remove that warning. The first is to change your development process and start using pull requests instead of committing straight to master.

The second is to turn that warning off. On the warnings tab there should be a button Manage Warnings that opens a dialogue where you can select what will trigger a warning. You want to unselect the Unreviewed Code checkbox.

Gene Taylor
  • 541
  • 2
  • 10
  • 7
    Hi, is there any definition on what a code review is? Is it only exclusive to Crucible, or can it be triggered via an API or somewhere on bitbucket? – Sean Mar 29 '17 at 10:28
  • 1
    I believe JIRA considers the code to be reviewed when a commit is part of a merged pull request. – voneiden Dec 12 '18 at 09:25
  • 1
    *For reference:* In current Jira version there is no **Warnings** tab and **Manage Warnings** menu item is placed under `...` button that is right from `Issues` title above issues list on a release details page. It was really hard to find, so I just leave it here for other people. – Ruslan Stelmachenko Apr 07 '23 at 19:26
9

This issue can happen regardless of using pull requests, for example if someone refers to the issue only in a merge commit message.

To resolve this and get rid of the warning, you can create an empty commit (git commit --allow-empty -m "Review ISSUE-13") in a new branch that references all the issues affected using the commit message. Then open a pull request for it and merge it as usual. Jira will see the pull request as being merged and the warning is cleared.

voneiden
  • 457
  • 4
  • 8