Package: jiratools
Some simple API functions and command-line tools for interacting with JIRA.SetupAll the tools and functions here need your specific information from
ajira.configfile in your home directory, so you have to do this setup
before anything can be used:runjira-example-config--installto install an example config file
(you can run it without--installto see the contents of what would be
installed. (If you already have ajira.configin your home directory,
this script willnotoverwrite it.)Fill out the values in the config file with your appropriate data
(see the comments in that file for guidance).Command-Line Toolsjira-example-configcan install an example config file for you, see above.jira-make-linked-issuemakes a new JIRA issue that is linked to an exisiting issue;
the new issue’s fields can be set from defaults in yourjira.configor those values can be overridden on the command line.
See--helpon this command for all the command line options,
and the comments injira.configfor setting the defaults.jira-add-commentadds a comment to a JIRA issue.
Thejira.configfile is needed to authenticate to JIRA.
No other data from thejira.configfile is used by this commmand.
See--helpon this command for details. You can also use-as your comment
andjira-add-commentwill read the comment from stdin instead. Note that if you
use-interactively, you cannot edit your comment before it is posted.jira-search-issuessearches JIRA using your JQL query.
Thejira.configfile is needed to authenticate to JIRA.
You may set a default integer max_results value
asMAX_RESULT_COUNTinjira.config,
or set a value of-1for no max by default.
See--helpon this command for details.jira-link-issuescreates a link between two issues.
Thejira.configis needed to authenticate to JIRA.jira-update-assigneechanges the assignee of the JIRA to the provided user.Error Logging ToolsThese functions are designed to be used within Python code
to assist with various error commenting logic.jiratools.error_logging.add_jira_error_commentcan take an error
and add a formatted comment to a relevant JIRA issuejiratools.error_logging.add_jira_comment_with_tablecan add a comment
with a formatted data table to a jira issuejiratools.error_logging.update_jira_for_errorscan check found errors
against a list of JIRA issues
and add comments to any JIRA issues where a match is found.Formatting ToolsThese functions are designed to be used within Python code
to assist with comment formatting logic.jiratools.formatting.format_autoupdate_jira_msgtakes a message body
and add relevant title/header datajiratools.formatting.format_as_jira_tabletakes headers and table rows
and formats a JIRA-style tableExamplesjira-add-commentJIRA-1234"Work in Progress. PR delayed by network problems."– Add the comment to JIRA-1234 using the user/password from yourjira.configNote that the comment has to be just one command line argument surrounded by quotes
if it contains spaces, etc.jira-make-linked-issueJIRA-1234– will create a JIRA in yourTEST_PROJECTto test JIRA-1234,
and link the two, assigning it to you and
adding any watchers specified in your default watchers list.jira-make-linked-issueJIRA-1234--projectOTHER– will create a test JIRA as above, but inOTHERjira-make-linked-issueJIRA-1234--userbobm5523– will create the JIRA as above, but assign tobobm5523jira-make-linked-issueJIRA-1234-wsall9987-wbenj4444– will create the JIRA and assignsall9987andbenj4444as watchers
instead of your default watcher listjira-search-issues"project=ABC AND summary ~ client"– will print a list of links and titles for issues in project ABC
that include the word “client” in the summary.jira-link-issuesABC-123XYZ-456– will create a link such thatABC-123relates toXYZ-456