Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with JIRA server API connection with github script field repository

Zachi Meyer March 15, 2022

Hi,

We have script field that getting repository info from stash, and we're examine the option to move to GitHub. 

We're using JIRA-server and connect with GitHub enterprise through DVCS connection

I tried to change "applicationType=github" instead of "stash" and I get error:

2022-03-15 12:29:33,154 WARN [runner.ScriptBindingsManager]: response: {"errors":[],"detail":[]}

 

This is the code of the script field that I'm using to get repository information:

 

GetMethod method = new GetMethod(baseUrl + "/rest/dev-status/1.0/issue/detail?issueId=" + issue.getId() + "&applicationType=github&dataType=pullrequest");

log.warn "method: $method"


Credentials credentials = new UsernamePasswordCredentials("[user]","[password]");
client.getParams().setAuthenticationPreemptive(true);
client.getState().setCredentials(AuthScope.ANY, credentials);
client.executeMethod(method);

def response = method.getResponseBodyAsString()
method.releaseConnection();
log.warn "response: $response"

 

 

Thanks.

 

1 answer

0 votes
Neil Mansilla
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 16, 2022

Hi @Zachi Meyer I'm going out on a limb here, because I'm not no subject matter expert on DVCS; however, I do recall seeing some code snippet (in some far reaches of my brain) where the applicationType for Github Enterprise is "githube". I'm not sure if that will solve your problem, but that is AFAIK the correct applicationType.

Zachi Meyer March 17, 2022

Thanks @Neil Mansilla , the githube works :) 

Is it because it's github enterprise?

Neil Mansilla
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 17, 2022

That's correct. I'll dig around a bit to see if there's a place where this needs to be documented.

Zachi Meyer March 20, 2022

Thanks, @NEIL ,

it needs to be documented since a lot of people asked about it.

Suggest an answer

Log in or Sign up to answer