how can one create a link between two issues using python jira api
Question:
I am trying to automate some issue creation tasks that I need to perform.. Well, I don’t like to click too much.
I have managed to create issues by
import jira
jira_conn = jira.JIRA('url_to_server')
issue_dict_a = dict(
project={'key': 'ABC'},
summary='summed up',
description='',
issuetype={'name': 'TypeA'},
)
iss_a = jira_conn.create_issue(fields=issue_dict_a)
# suppose this is issue ABC-1
# issue_dict_a = dict(...)
iss_b = jira_conn.create_issue(fields=issue_dict_b)
# suppose this is issue ABC-2
However, I then want to link them using something like
jira_conn.create_issue_link(typestr, inwardIssue='ABC-1', outwardIssue='CSV-2')
But what dows the typestr
need to be? Where do I get the right type from? How is it specified?
Thanks!
Answers:
ah I just realized that it works, using the string from the link to menu.
For example typestr = "blocks"
.
I hope that helps somebody.. 🙂
The documentation says the type of link between two issues.
In Jira, the issue can be below examples, so you can try them:
- "relates to"
- "duplicates" / "is duplicated by"
- "blocks" / "is blocked by"
- "clones" / "is cloned by"
I am trying to automate some issue creation tasks that I need to perform.. Well, I don’t like to click too much.
I have managed to create issues by
import jira
jira_conn = jira.JIRA('url_to_server')
issue_dict_a = dict(
project={'key': 'ABC'},
summary='summed up',
description='',
issuetype={'name': 'TypeA'},
)
iss_a = jira_conn.create_issue(fields=issue_dict_a)
# suppose this is issue ABC-1
# issue_dict_a = dict(...)
iss_b = jira_conn.create_issue(fields=issue_dict_b)
# suppose this is issue ABC-2
However, I then want to link them using something like
jira_conn.create_issue_link(typestr, inwardIssue='ABC-1', outwardIssue='CSV-2')
But what dows the typestr
need to be? Where do I get the right type from? How is it specified?
Thanks!
ah I just realized that it works, using the string from the link to menu.
For example typestr = "blocks"
.
I hope that helps somebody.. 🙂
The documentation says the type of link between two issues.
In Jira, the issue can be below examples, so you can try them:
- "relates to"
- "duplicates" / "is duplicated by"
- "blocks" / "is blocked by"
- "clones" / "is cloned by"