This pack consists of a sample Jira sensor and a Jira action.
You will need to have gcc
installed on your system.
For Ubuntu systems, run sudo apt-get install gcc
.
For Redhat/CentOS systems, run sudo yum install gcc libffi-devel python-devel openssl-devel
.
To build the python cryptography dependency (part of the following st2 pack install
command) 2GB of RAM is recommended.
In some cases adding a swap file may eliminate strange gcc compiler errors.
Then install this pack with: st2 pack install jira
Copy the example configuration in jira.yaml.example
to /opt/stackstorm/configs/jira.yaml
and edit as required.
url
- URL of the Jira instance (e.g. https://myproject.atlassian.net
)poll_interval
- Polling interval - default 30sproject
- Key of the project which will be used as a default with some of the actions which
don't require or allow you to specify a project (e.g. STORM
).verify
- Verify SSL certificates. Default True. Set to False to disable verificationauth_method
- Specify either basic
, oauth
, api_token
or PAT
authenticationInclude the following settings when using the oauth
auth_method:
rsa_cert_file
- Path to the file with a private keyoauth_token
- OAuth tokenoauth_secret
- OAuth secretconsumer_key
- Consumer keyInclude the following settings when using the basic
auth_method:
username
- Usernamepassword
- PasswordInclude the following settings when using the PAT
auth_method:
token
- PAT tokenInclude the following settings when using the api_token
auth_method:
token
- api tokenusername
- UsernameIf using the oauth
auth_method, take a look at the OAuth section below for further setup instructions.
You can also use dynamic values from the datastore. See the docs for more info.
Note : When modifying the configuration in /opt/stackstorm/configs/
please
remember to tell StackStorm to load these new values by running
st2ctl reload --register-configs
This documentation is written as of 06/17/2014. Jira 6.3 implements OAuth1. Most of this document would need to be revised when Jira switches to OAuth2.
$ openssl genrsa -out stackstorm-jira.pem 4096
$ openssl rsa -in stackstorm-jira.pem -pubout
$ python
Python 2.7.10 (default, Jul 30 2016, 19:40:32)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import uuid
>>> print uuid.uuid4()
210660f1-ca8a-40d5-a6ee-295ccbf3074d
>>>
Configure Jira for external access:
https://{jira_server}/plugins/servlet/applinks/listApplicationLinks
Get access token using this script. You may need to install additional libraries to run that script, and you will need to edit the script to use your file locations. Check the README file for more information. The access token is printed at the end of running that script. Save these keys somewhere safe.
Plug in the access token and access secret into the sensor or action. You are good to make Jira calls. Note: OAuth token expires. You'll have to repeat the process based on the expiry date.
JiraSensor
- Sensor which monitors JIRA for new tickets.JiraSensorForAPIv2
- Sensor which monitors JIRA for new tickets.The sensor monitors for new tickets and sends a trigger into the system whenever there is a new ticket.
add_field_value
- Add a field to a particular JIRA issue.assign_issue
- Assigning an issue to a user.attach_file_to_issue
- Attach a file to JIRA issue / ticket.attach_files_to_issue
- Attach multiple files to JIRA issue / ticket.bulk_link_issue
- Link many JIRA issues to another JIRA issue.comment_issue
- Comment on a JIRA issue / ticket.create_issue
- Create a new JIRA issue / ticket.get_issue
- Retrieve information about a particular JIRA issue.get_issue_attachments
- Retrieve attachments for a particular JIRA issue.get_issue_comments
- Retrieve comments for a particular JIRA issue.get_issue_links
- Retrieve linked issues for a particular JIRA issue.link_issue
- Link one JIRA issue to another JIRA issue.search_issues
- Search JIRA issues with a JQL query.transition_issue
- Do a transition on a JIRA issue / ticket.transition_issue_by_name
- Do a transition on a JIRA issue / ticket.update_field_value
- Update a field in a particular JIRA issue.add_gadget
- Add a gadget to an existing JIRA dashboard.copy_dashboard
- Copy an existing JIRA dashboardcreate_dashboard
- Create a JIRA dashboarddelete_dashboard_item_property
- Delete a JIRA dashboard item property.delete_dashboard
- Delete a JIRA dashboard.get_available_gadgets
- Get all available JIRA dashboard gadgets.get_dashboard_gadgets
- Get all JIRA dashboard gadgets for an existing dashboard.get_dashboard_item_property_keys
- Get the dashboard item (gadget) property keys for an existing dashboard.get_dashboard_item_property
- Get a dashboard item (gadget) property from a gadget on JIRA dashboard.remove_gadget
- Remove a gadget from a JIRA dashboard.set_dashboard_item_property
- Set the value of a dashboard item (gadget) property on a JIRA dashboard.update_dashboard_automatic_refresh
- Set the refresh interval for JIRA dashboard in minutes.update_dashboard_item_property
- Update the value of a dashboard item (gadget) property on a JIRA dashboard.update_dashboard
- Update an existing JIRA dashboard.update_gadget
- Update an existing gadget on a JIRA dashboard.Active pack maintainers with review & write repository access and expertise with JIRA: