Installation

pip install jira-agile-toolbox

API documentation

class jira_agile_toolbox.JiraAgileToolBox(jira_client)

a class which helps you do agile things with jira

Parameters

jira_client (jira.JIRA) – an instance of jira.JIRA

Example

>>> from jira import JIRA
>>> jira_client = JIRA("https://jira.atlassian.org")
>>> jat = JiraAgileToolBox(jira_client)
add_labels_to_all_sub_items_of_epic(epic, labels)

adds labels to all ‘Issues in Epic’

Parameters
  • epic (str jira.Issue) – and epic key as a string or the epic as a jira.Issue

  • labels (str list) – the label to set as a string or the labels to set as a list

Example

>>> from jira_agile_toolbox import JiraAgileToolBox
>>> from jira import JIRA
>>> my_jira_client = JIRA("https://my-jira-server.com", basic_auth=("MYUSERNAME","MYPASSWORD")
>>> tb = JiraAgileToolBox(my_jira_client)
>>> tb.add_labels_to_all_sub_items_of_epic("PROJ001-001", ["label_to_set"])

this will append the “label_to_set” to all existing labels of all Issues in Epic

copy_fix_version_from_epic_to_all_items_in_epic(epic)

copies fixVersions from the epic to all ‘Issues in Epic’

Parameters

epic (str jira.Issue) – and epic key as a string or the epic as a jira.Issue

Returns

None

Example

>>> from jira_agile_toolbox import JiraAgileToolBox
>>> from jira import JIRA
>>> my_jira_client = JIRA("https://my-jira-server.com", basic_auth=("MYUSERNAME","MYPASSWORD")
>>> tb = JiraAgileToolBox(my_jira_client)
>>> epic = my_jira_client.issue("PROJ001-001")
>>> epic.fields.fixVersions
[<JIRA Version: name='0.0.10', id='31063'>]
>>> tb.copy_fix_version_from_epic_to_all_items_in_epic(epic)
>>> tb.get_all_issues_in_epic("JAT-001")[0].fields.fixVersions
[<JIRA Version: name='0.0.10', id='31063'>]
get_all_issues_in_epic(epic, fields=None)

gets all ‘Issues in Epic’ as a list

Example

>>> from jira_agile_toolbox import JiraAgileToolBox
>>> from jira import JIRA
>>> my_jira_client = JIRA("https://my-jira-server.com", basic_auth=("MYUSERNAME","MYPASSWORD")
>>> tb = JiraAgileToolBox(my_jira_client)
>>> tb.get_all_issues_in_epic("JAT-001")
[<JIRA Issue: key='JAT-002', id='67'>, <JIRA Issue: key='JAT-003', id='68'>, <JIRA Issue: key='JAT-004', id='69'>]
Parameters
  • epic (str jira.Issue) – and epic key as a string or the epic as a jira.Issue

  • fields (str list) – a string or list of strings to limit the fields to get this helps to lower the amount of data to be sent around

Returns

a list of jira.Issues

Return type

list

get_storypoints_from_epic(epic)

searches for the epic and returns the number of storypoints as a dict

Parameters

epic (str jira.Issue) – and epic key as a string or the epic as a jira.Issue

Returns

a dictionary containing total story points

Return type

dict

Example

>>> from jira_agile_toolbox import JiraAgileToolBox
>>> from jira import JIRA
>>> my_jira_client = JIRA("https://my-jira-server.com", basic_auth=("MYUSERNAME","MYPASSWORD")
>>> tb = JiraAgileToolBox(my_jira_client)
>>> tb.get_storypoints_from_epic("JAT-001")
{'total': 100, "Reported": 50, "Closed": 50}
rank_issues_at_top_of_project(ranked_list, project)

moves the provided ranked_list at the top of the backlog of the given project

Parameters
  • ranked_list – a list of jira Issues

  • project (str) – project key

Example

>>> from jira_agile_toolbox import JiraAgileToolBox
>>> from jira import JIRA
>>> my_jira_client = JIRA("https://my-jira-server.com", basic_auth=("MYUSERNAME","MYPASSWORD")
>>> tb = JiraAgileToolBox(my_jira_client)
>>> tb.rank_issues_by_list([my_jira_client.issue("JAT-001"), my_jira_client.issue("JAT-003")])

will produce following result

before

after

JAT-010

JAT-001

JAT-005

JAT-003

JAT-003

JAT-010

JAT-002

JAT-005

JAT-001

JAT-002

rank_issues_by_list(ranked_list, on_top_of_issue)

sorts the provided list by rank on top of the latter issue

Parameters
  • ranked_list – list of issues to be sorted by rank index 0 has highest rank

  • on_top_of_issue – issue on top of which these issues need to land

Example

>>> from jira_agile_toolbox import JiraAgileToolBox
>>> from jira import JIRA
>>> my_jira_client = JIRA("https://my-jira-server.com", basic_auth=("MYUSERNAME","MYPASSWORD")
>>> tb = JiraAgileToolBox(my_jira_client)
>>> tb.rank_issues_by_list([my_jira_client.issue("JAT-001"), my_jira_client.issue("JAT-003")], my_jira_client.issue("JAT-005"))

will rank issues like:

before

after

JAT-010

JAT-010

JAT-005

JAT-001

JAT-003

JAT-003

JAT-002

JAT-005

JAT-001

JAT-002

Indices and tables