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

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

This widget could not be displayed.

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.

This widget could not be displayed.

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.

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?

Thanks,

Trent

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?

Thanks,

Trent

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: http://stackoverflow.com/questions/18157583/git-credential-helper-cache-never-forgets-the-password

Adam

This widget could not be displayed.

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
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,269 views 8 11
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you