Creating Branch from Jira

Mark Bewley
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.
December 4, 2013

I have been told this feature is working by design; but I am still have an issue where this feature will not work with our implementation.

https://jira.atlassian.com/browse/JRA-35413

How can I modify my configuration to achieve our requirements, and make this feature work?

Configuration

Our Jira and Stash instances are on the same server behind an IIS proxy accessed using https. Outside of the company firewall a client SSL certificate is needed to access the IIS webpages. We also use Crowd to manage logins will connectivety to our AD.

Jira server.xml

In Jira server.xml we have two connectors, 1 for the https proxy, the other for localhost http. The context path is also set to /jira.

<!-- Apache Proxy Connector -->
<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8080" protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true" scheme="https" proxyName="example.com" proxyPort="443"/>

<!-- Standard HTTP Connector -->
<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8081" protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true"/>

<Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

Stash server.xml

Similarly in Stash we have two connectores and a context path for /stash.

<Connector port="7990" protocol="HTTP/1.1"
connectionTimeout="20000"
useBodyEncodingForURI="true"
redirectPort="9443"
compression="on"
compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"
scheme="https"
proxyName="example.com" proxyPort="443" />

<Connector port="7991" protocol="HTTP/1.1"
connectionTimeout="20000"
useBodyEncodingForURI="true"
redirectPort="9443"
compression="on"
compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"/>

<Context docBase="${catalina.home}/atlassian-stash"
path="/stash"
reloadable="false"
useHttpOnly="true"/>

Jira Application Link

To Stash we have:

Application URL: http://localhost:7991/stash

Display URL: https://example.com/stash

Stash Application Link

To Jira we have:

Application URL: http://localhost:8081/stash

Display URL: https://example.com/jira

Create Branch

With the above settings we can see Jira issues in Stash and view commits in Stash from Jira. The only feature the 'misbehaves' is the Create Branch from Jira.

For example, clicking the "Create Branch" link takes me to http://localhost:7991/stash/plugins/servlet/create-branch?issueKey=KEY9999-6&issueType=New+Feature&Something

To work correctly the url should be something like https://example.com/stash/plugins/servlet/create-branch?issueKey=KEY9999-6&issueType=New+Feature&Something

navigation.json

The url https://example.com/stash/rest/capabilities/navigation returns (edited):

{
"links":{
"self":"https://example.com/stash/rest/capabilities/navigation",
"collection":"https://example.com/stash/rest/capabilities",
"base":"https://example.com/stash/"
}, "home":[
{
"href": "https://example.com/stash/", "label": "Stash", "tooltip": "", "lang": "en-GB", "weight":300
}
], "profile":[
{
"href": "https://example.com/stash/profile", "label": "Stash Profile", "tooltip": "", "lang": "en-GB", "weight":300
}
], "admin":[
{
"href": "https://example.com/stash/admin", "label": "Stash Admin", "tooltip": "", "lang": "en-GB", "weight":300
}
], "create-branch":[
{
"href": "https://example.com/stash/plugins/servlet/create-branch", "label": "Stash", "icon": "https://example.com/stash/plugins/servlet/create-branch/icon.png", "tooltip": "", "lang": "en-GB", "weight":300
}
], "custom-apps":[
{
"href": "https://example.com/openidserver", "label": "Crowd ID", "tooltip": "", "lang": "en-GB", "weight":2147483646
}, {
"href": "https://example.com/jira", "label": "Jira", "tooltip": "", "lang": "en-GB", "weight":2147483646
}
]}

On the server, the url http://localhost:7991/stash/rest/capabilities/navigation returns (edited):

{
"links":{
"self":"http://localhost:7991/stash/rest/capabilities/navigation",
"collection":"http://localhost:7991/stash/rest/capabilities",
"base":"http://localhost:7991/stash/"
}, "home":[
{
"href": "http://localhost:7991/stash/", "label": "Stash", "tooltip": "", "lang": "en-GB", "weight":300
}
], "admin":[
{
"href": "http://localhost:7991/stash/admin", "label": "Stash Admin", "tooltip": "", "lang": "en-GB", "weight":300
}
], "profile":[
{
"href": "http://localhost:7991/stash/profile", "label": "Stash Profile", "tooltip": "", "lang": "en-GB", "weight":300
}
], "create-branch":[
{
"href": "http://localhost:7991/stash/plugins/servlet/create-branch", "label": "Stash", "icon": "http://localhost:7991/stash/plugins/servlet/create-branch/icon.png", "tooltip": "", "lang": "en-GB", "weight":300
}
], "custom-apps":[
{
"href": "https://example.com/openidserver", "label": "Crowd ID", "tooltip": "", "lang": "en-GB", "weight":2147483646
}, {
"href": "https://example.com/jira", "label": "Jira", "tooltip": "", "lang": "en-GB", "weight":2147483646
}
]}

Thanks,

Mark

2 answers

1 accepted

0 votes
Answer accepted
Mark Bewley
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.
April 20, 2014

After upgrading to 2.12.1 the "Create Branch" link from jira now behaves as expected.

0 votes
Pedro Cora
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 4, 2013

I believe that you might need to change the application link and send it thru the SSL pipes as well. The way that you describe won't work, as it's detailed in JRA-35413.

Mark Bewley
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 27, 2014

To update an old question, setting the application to use SSL is an option.

I believe the reason the "Create Branch" lnk goes to localhost is due to the issue decribed in https://jira.atlassian.com/browse/STASH-4250. I will have to wait for the release of version 2.12.0 to confirm if this has resolved my problem.

Suggest an answer

Log in or Sign up to answer