It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ScriptRunner for Bitbucket "Require commits to be associated with a JIRA issue" Failing

Trent Dailey Feb 21, 2017

We are having an issue where one user is getting an error when trying to commit with a valid JIRA issue.  The JQL we have setup is project in myProjects().  This works for all users who have tested it except for one.  The user who is having the issue is an administrator of the JIRA project, and the JIRA issue number is valid as other users are not having the same issue with the same JIRA issue number.


We are unable to see anything in the logs other than the commit is rejected.

3 answers

1 vote
Trent Dailey Feb 22, 2017

Hi Adam,

So the issue is the user is using SSH keys to make the connection, and the SSH key is setup with his email address and not his JIRA ID.

If he creates a new SSH key with his JIRA ID will it work, or does this hook only work when committing with HTTPS.

1 vote
Adam Markham [Adaptavist] Community Leader Feb 22, 2017

This should work regardless of using SSH or HTTPS, as long as it's setup correctly. Are any other users using SSH with this hook?

You may want to check the repository contains the correct remote base url by running:

git remote -v

It should look similar to the ones here.

Trent Dailey Feb 27, 2017

Hi Adam,

Yes we have other users that are using SSH there.  He also just tried to switch to HTTPS and had the same issue with the hook.  Below is log output.

 https | o@1O3A096x556x4729749x0 | E731TK | 2017-02-23 09:16:36,919 | "GET /scm/rcs/rental-clients-training.git/info/refs HTTP/1.1" | "" "git/2.10.1" | 200 | 0 | 865 | refs | 433 | - |
 https | o@1O3A096x556x4729751x0 | E731TK | 2017-02-23 09:16:38,179 | "POST /scm/rcs/rental-clients-training.git/git-upload-pack HTTP/1.1" | "" "git/2.10.1" | 200 | 341 | 178025 | cache:miss, clone | 909 | - |
 https | o@1O3A096x559x4730353x1 | E731TK | 2017-02-23 09:19:05,598 | "GET /scm/rcs/rental-clients-training.git/info/refs HTTP/1.1" | "" "git/2.10.1" | 200 | 0 | 735 | refs | 394 | - |
https | o@1O3A096x559x4730355x1 | E731TK | 2017-02-23 09:19:08,078 | "POST /scm/rcs/rental-clients-training.git/git-receive-pack HTTP/1.1" | "" "git/2.10.1" | 200 | 495 | 366 | push, rejected | 2094 | - |


He also has no issues making commits when the require JIRA commits hook is disabled.  I will check if other users on his team are using SSH but I believe others are without issues.  Is there a way to enable more logging for that hook so it will output more information?



Trent Dailey Mar 02, 2017

Hi Adam,

Any update on this?  Any way to enable extra logging to see what username is being passed to JIRA or anything like that?



Adam Markham [Adaptavist] Community Leader Mar 02, 2017

Hi Trent,

I haven't found much. Could you get the user to reset their credentials, in particular the credentials cache for that repository. Maybe they are wrong. There are some instructions here for doing this in Git here:


0 votes
Adam Markham [Adaptavist] Community Leader Feb 21, 2017

Can you get the user to run the same JQL query in the JIRA advanced search? What comes back? Also does this user have the same details like username etc in Bitbucket and JIRA?

It sounds like there is something specific about this user that is causing this problem.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,975 views 1 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you