Forums

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

Getting issue links from multiple servers jira python api

Sathesh Balakrishnan Manohar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 6, 2018

I am trying to get issues from multiple servers, Links exist between servers jira1.abc.com and jira2.abc.com. When I run this I get issues links only from jira2. Is there anyways I could get it from other server ?

from jira import JIRA

jira = JIRA('https://jira2.abc.com')
issue = jira.issue('QAD-9325')
links = issue.fields.issuelinksfor link in links:
    if hasattr(link, "outwardIssue"):        outwardIssue = link.outwardIssue
        print("\tOutward: " + outwardIssue.key)
    if hasattr(link, "inwardIssue"):        inwardIssue = link.inwardIssue
        print("\tInward: " + inwardIssue.key)

 

1 answer

0 votes
Edwin Kyalangalilwa
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.
November 6, 2018

Hi @Sathesh Balakrishnan Manohar,

You'd have to specify two jira variables.

jira1 = JIRA('https://jira1.abc.com')
jira2 = JIRA('https://jira2.abc.com')

issue1 = jira1.issue('QAD-9325')
issue2 = jira2.issue('QAD-9325')

Or do you mean external links?

Sathesh Balakrishnan Manohar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 6, 2018

QAD-9325 exists only in "jira2.abc.com", and it has multiple jiras that it blocks which are in "jira1.abc.com" .I will not be able to use two jira variables because QAD-9325 on jira1 would throw an error, because it doesn't exist there.

Suggest an answer

Log in or Sign up to answer