Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

trent-dailey February 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
adammarkham
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 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 February 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?

Thanks,

Trent

trent-dailey March 2, 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?

Thanks,

Trent

adammarkham
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 2, 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: http://stackoverflow.com/questions/18157583/git-credential-helper-cache-never-forgets-the-password

Adam

1 vote
trent-dailey February 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.

0 votes
adammarkham
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 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
TAGS
AUG Leaders

Atlassian Community Events