Closed AmrAbuAbdo closed 7 years ago
I forgot to mention that Application link is properly configured between JIRA and Bitbucket, and the GIT version on our Bitbucket server is 2.14 > 2.11 Looking forward to your help :)
I released 3.10 now with debug logging in se.bjurr.sbcc.JiraClient
. That output may help.
I would try to perform the rest call with curl
from the server running Bitbucket Server.
It should be something like: curl https://someserver/rest/api/2/search?jql=issuekey+%3D+GOB-7+AND+status+%3D+%22In+Progress%22
Thanks for your reply Tomas, and Congrats on the new release :D I did try the curl you send and the below was the result: {"startAt":0,"maxResults":50,"total":0,"issues":[]} The same query return a result when trying it through the UI.
And the below is the debug log : "POST /scm/sec/goblin.git/git-receive-pack HTTP/1.1" se.bjurr.sbcc.SbccRepositoryHook Using settings: SbccSettings [commitDiffRegexp=null, commitDiffRegexpMessage=null, commitSizeMessage=null, commitSize=0, acceptMessage=null, branches=null, dryRun=false, dryRunMessage=null, excludeMergeCommits=true, excludeTagCommits=true, groups=[], rejectMessage=null, requireMatchingAuthorEmail=false, requireMatchingCommitterEmail=false, requireMatchingAuthorEmailMessage=null, requireMatchingAuthorName=false, requireMatchingAuthorNameSlug=false, requireMatchingCommitterName=false, requireMatchingCommitterNameSlug=false, requireMatchingAuthorNameMessage=null, requireOnlyOneIssue=false, requireOnlyOneIssueMessage=null, branchRejectionRegexp=null, branchRejectionRegexpMessage=null, allowServiceUsers=false, requireMatchingAuthorEmailRegexp=null, jqlCheck=true, jqlCheckMessage=JIRA failed, jqlCheckQuery=issuekey = ${REGEXP}, commitRegexp=\ba-zA-Z-([0-9]+)\b, requireMatchingAuthorEmailInBitbucket=false, requireMatchingAuthorNameInBitbucket=false, requireMatchingAuthorNameInBitbucketSlug=false, shouldCheckPullRequests=false, shouldCheckPullRequestsMessage=null, ignoreUsersPattern=null] "POST /scm/sec/goblin.git/git-receive-pack HTTP/1.1" se.bjurr.sbcc.RefChangeValidator Amro AbuAbdo amro.abuabdo@progressoft.com> RefChange 403eac2b50c182fd5069bc2a7ea6cfb4fb0e35d6 refs/heads/master 3e604d5ab71c7cd51645a8e53109f9048fd798e1 UPDATE "POST /scm/sec/goblin.git/git-receive-pack HTTP/1.1" c.a.bitbucket.scm.BaseCommand Executed /usr/bin/git rev-list --format=%H%x02%P%x02%cN%x02%cE%x02%aN%x02%aE%n%B%n%x03END%x04 3e604d5ab71c7cd51645a8e53109f9048fd798e1 --not --all -- "POST /scm/sec/goblin.git/git-receive-pack HTTP/1.1" s.b.sbcc.commits.ChangeSetsService Checking 3e604d5ab71c7cd51645a8e53109f9048fd798e1 "POST /scm/sec/goblin.git/git-receive-pack HTTP/1.1" s.b.sbcc.commits.ChangeSetsService Checking b8a3a296d943735f4bd873ec494d0649eca48b9c "POST /scm/sec/goblin.git/git-receive-pack HTTP/1.1" c.a.s.i.h.r.DefaultRepositoryHookService [SEC/goblin[322]] hook 'pre-receive-repository-hook' vetoed the push request "POST /scm/sec/goblin.git/git-receive-pack HTTP/1.1" c.a.bitbucket.scm.BaseCommand Executed /usr/bin/git http-backend
Thanks again :)
I'm guessing it can be an authentication problem.
If you perform the curl command with autnetication, does that work? https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-basic-authentication
Yes it worked like charm! after providing -u user:password to the curl. However, how can I provide authentication to make the plugin work ?
I would look into the application link in Bitbucket Server: https://confluence.atlassian.com/bitbucketserver/linking-bitbucket-server-with-jira-776640408.html
And make sure authentication is done properly.
The plugin just uses whatever is configured in Bitbucket: https://github.com/tomasbjerre/simple-bitbucket-commit-checker/blob/master/src/main/java/se/bjurr/sbcc/JiraClient.java#L41
I had to replace the Authentication method to be (OAuth impersonation) instead of (OAuth) and qorked sauccessfully :D Thanks a lot!
np!
It keeps rejecting the push with the below msg: At least one commit is not ok JQL: issuekey = GOB-7 AND status = "In Progress"
However, If I apply the above query on JIRA it return result! Thanks in advance :+1: