Skip to content

Commit

Permalink
feat: add command to list issue transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrts committed Jan 9, 2023
1 parent 4dcf4d4 commit 270e968
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Here's the default help:
'projects': List available JIRA projects
'sum_timetracking_for_jql': Sum original estimate, time spent
and time remaining for all issues that match the given JQL query
'transitions': List available JIRA transitions for the given issue

optional arguments:
-h, --help show this help message and exit
Expand Down
14 changes: 12 additions & 2 deletions ask-jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,29 @@ def _make_jql_argument_parser(parser):
parser.add_argument("jql", help="the JQL query used in the command")
return parser

def _make_transitions_argument_parser(parser):
parser.add_argument("issue", help="the JIRA issue key used in the command")
return parser

# commands

def projects(jira, args):
"""List available JIRA projects"""
projects = jira.projects()
print("Available JIRA projects:")
pprint.pprint([project.name for project in projects])
pprint.pprint([project.name for project in jira.projects()])

def fields(jira, args):
"""List available JIRA field names and IDs"""
print("Available JIRA fields (name, id):")
pprint.pprint([(field['name'], field['id']) for field in jira.fields()])

def transitions(jira, args):
"""List available JIRA transitions for the given issue"""
print("Available JIRA transitions:")
pprint.pprint(jira.transitions(args.issue))

transitions.argparser = _make_transitions_argument_parser

def sum_timetracking_for_jql(jira, args):
"""Sum original estimate, time spent
and time remaining for all issues that match the given JQL query"""
Expand Down

0 comments on commit 270e968

Please sign in to comment.