Require commits to be associated with a JIRA issue

Ravi March 15, 2016

We recently purchased scriptrunner plugin for stash 

I am trying to test integration with JIRA   and here is how we have configured the JQL for  in bulit pre-receive hook

project = PLAY and status = "In Progress" and Assignee = CurrentUser()

However I am receiving the following message . 

remote:
remote:
=====================================================================
remote: One or more JIRA issues
from your commits not found by query (project = PLAY and status = "In
Progress" and assignee = currentUser()):
remote:
remote:        
Ref: 32fa7208210 - PLAY-1234
remote:
=====================================================================
remote:

 We also confirmed the JIRA ->Stash application link is established.  If the hook is not used we can commit and changes appear under source tab

What is the best way to troubleshoot to find out the root cause ?

Thanks

Ravi

8 answers

1 vote
Shubham Aggarwal July 21, 2017

Was this resolved? We're facing the same issue. We're using Oauth.

0 votes
JamieA
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 16, 2016

Can you say if you are using trusted apps, or oauth, or both? Best to create a support ticket at productsupport.adaptavist.com/servicedesk/customer/portal/3 including screenshots of the app link config.

0 votes
Ravi March 15, 2016

Well it is not for working for us . How can we troubleshoot the problem ? Is there a sample qroovy script that we can run in script console to test if stash can retrieve the JIRA issue ?

0 votes
JamieA
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 15, 2016

Earlier you said you were using OAuth...? If you set it to use trusted apps it should work.

0 votes
Ravi March 15, 2016

Hi Jamie 

 

I confirmed that app links are not using oauth, instead they are configured via Trusted application. If you look at the error message it is not a authorization error Stash can talk to JIRA  . I confirmed that without scriptrunner configuration we can commit the changes against JI and  source tab shows the stash changes.

FYI we are using 3.10 version of stash with 4.1 version of script runner plugin.

Ravi.

 

0 votes
JamieA
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 15, 2016

Hi Ravi... right now it only works if the "trusted applications" is configured. But the next version, which will be released any day, supports oauth. If you create a support ticket at productsupport.adaptavist.com/servicedesk/customer/portal/3 we will make sure you are aware when it's released. 

The user will receive a reject message like this:

remote:
remote: =====================================================================
remote: Please visit:
remote:
remote:         https://.../plugins/servlet/applinks/oauth/login-dance/authorize?applicationLinkID=4ae85c5f-4b27-3b1c-9f9e-025c0ea61679
remote:
remote: to authorize Bitbucket to view JIRA on your behalf.
remote: =====================================================================
remote:

They will need to click that link, then retry.

 

0 votes
Ravi March 15, 2016

Hi Jamie

I do get the issue listed as in progress when the JQL is executed in JIRA . Also we are using oath configuration for app links.

 

Thanks

Ravi.

0 votes
JamieA
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 15, 2016

Hi... can you confirm that the query:

project = PLAY and status = "In
Progress" and assignee = currentUser() and key = PLAY-1234

returns one issue when run in jira as the same user doing the push?

What is the security configuration of the app link, eg oauth, trusted applications...?

We'll follow up with you tomorrow.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events