Issue with using smart commits when JIRA issue created with Rest API.

Prediction Sysadmins September 15, 2017

When the user creates a JIRA issue manually and then commits manually which references the JIRA issue, and all works as it is supposed to (the commit causes comments to be added to the JIRA issue and the state to be changed, as I specified).

However, when the user creates the JIRA issues using the Rest API then create the commits with the necessary smart commit cookies in the commit message, and pushing these to BitBucket there are issues with creating comments and with updating the state of the issue. However, it doesn’t look like JIRA is completely out of the loop, because it is providing a link back to the commit in BitBucket.

Thanks

1 answer

0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 18, 2017

Hi Team,

You stated

...there are issues with creating comments and with updating the state of the issue...

  1. Can you clarify what those issues specifically are?
  2. Do they not work at all or do they not work in a way you're expecting?
  3. What is an example of the smart commit message you're using?

Cheers,

Branden

Prediction Sysadmins September 18, 2017

BitBucket and JIRA are each linked to each other, and Smart Commit is enabled. User has same email address in .gitconfig, BitBucket and JIRA (in fact BitBucket is using the JIRA account).

Doing toy examples (touch one file, commit with message as follows):

A simple commit message summary

A simple commit message body

KEY-1 KEY-2 #done #comment This is a comment

will cause the Commits page entry in BitBucket to contain links to issues KEY-1 and KEY-2, the ‘development’ section of the issue pages will contain links to the commit, the comment will appear in the comment sections for those two issues in JIRA, and the issues will be moved to the done state.

However, under various conditions which arise in real life, the Smart Commit fails. Namely, if the commit message contains more than about 1000 characters (with the smart commit cookies either on the first line after the summary or on the last line), or if the commit involves a larger number of files. This can be demonstrated with exactly identical smart commit text as above. The result is that the BitBucket Commits page contains the links to the issues in JIRA, and the issue page in JIRA lists the commits in the ‘development’ section, but the comment is not entered in the comments section, and the state of the issue is not changed to Done. There are no errors in any log (either from BitBucket or from JIRA), no error email, no indication that anything went wrong.

We’ve run BitBucket with debug logging, and we can see all the event traffic back and forth between BitBucket and JIRA, and no apparent error. But the issues are simply not getting updated as they should be.

It also appears that it may fail when several “toy” commits are pushed to BitBucket in a single push action. Again, in the debug log we see all the event messaging back and forth for all the commits, but none of the modifications of the issue are effected.

Versions: bitbucket-4.8.3  jira-7.1.9

Prediction Sysadmins September 19, 2017

Hi there. Wanted to let you know we did a completely clean new install (with eval license) with all the latest (JIRA 7.5.0, BitBucket Server 5.3.1). We continue to see the same behavior.

An additional data point: even when the commit message is small (<200 characters), if the commit itself has more than some undetermined amount of changes (many files and/or many lines?), the update of the issues will fail.

Mark A_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 21, 2017

Hello,

My name is Mark and I am on the Bitbucket Server team.

I attempted to reproduce your issue with the latest versions of the software you tested but was unable to do so.

I performed a simple push with your commit format and was able to get it through to JIRA and have the workflow transitioned and the comment added.

I then tested with making the comment 800+ characters and the JIRA workflow transition and comment addition were a success.

The third test, the comment was over 10k characters. Again, all actions were successful.

The fourth test included a comment that was over 10k characters, with 27 files generated via your 'toy' method. This was done successfully.

The last test, I created the JIRA issue via REST API, and then git pushed using the 'toy' method with 27 files and a comment with over 10k characters. JIRA was successful in transitioning the issue and adding a comment.

My environment:
- Bitbucket Server 5.3.1
- JIRA Software 7.5.0
- No proxy

Observations

Typically, you keep your commit message character limit low. Some use the 50/72 rule. With that said, we take what you give but there is some truncating. Bitbucket Server truncates some of the message text and JIRA truncates what it uses as well but nothing was ever rejected or erred.

I believe that there is potentially a failure from Bitbucket Server to JIRA, or with JIRA executing the devstatus event. To investigate further, we would need debug logs from BOTH Bitbucket Server AND JIRA that reproduce the issue.

Due to this, I went ahead and created a support case for you. You should have received an email notification with a link to that case. We can continue your investigation there so as not to share private data.

Cheers,

Mark

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events