You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pack consists of a sample JIRA sensor and a JIRA action.
3
+
This pack consists of a sample Jira sensor and a Jira action.
4
4
5
5
## Installation
6
6
7
-
You will need to have `gcc` installed on your system. For Ubuntu systems, run `sudo apt-get install gcc`. For Redhat/CentOS
8
-
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.
7
+
You will need to have `gcc` installed on your system.
8
+
For Ubuntu systems, run `sudo apt-get install gcc`.
9
+
For Redhat/CentOS systems, run `sudo yum install gcc libffi-devel python-devel openssl-devel`.
10
+
To build the python cryptography dependency (part of the following `st2 pack install` command) 2GB of RAM is recommended.
11
+
In some cases adding a swap file may eliminate strange gcc compiler errors.
9
12
10
13
Then install this pack with: `st2 pack install jira`
11
14
@@ -14,24 +17,27 @@ Then install this pack with: `st2 pack install jira`
14
17
Copy the example configuration in [jira.yaml.example](./jira.yaml.example)
15
18
to `/opt/stackstorm/configs/jira.yaml` and edit as required.
16
19
17
-
*``url`` - URL of the JIRA instance (e.g. ``https://myproject.atlassian.net``)
20
+
*``url`` - URL of the Jira instance (e.g. ``https://myproject.atlassian.net``)
*``project`` - Key of the project which will be used as a default with some of the actions which
20
23
don't require or allow you to specify a project (e.g. ``STORM``).
21
24
*``verify`` - Verify SSL certificates. Default True. Set to False to disable verification
22
25
*``auth_method`` - Specify either `basic`, `oauth` or `PAT` authentication
23
26
24
27
Include the following settings when using the `oauth` auth_method:
28
+
25
29
*``rsa_cert_file`` - Path to the file with a private key
26
30
*``oauth_token`` - OAuth token
27
31
*``oauth_secret`` - OAuth secret
28
32
*``consumer_key`` - Consumer key
29
33
30
34
Include the following settings when using the `basic` auth_method:
35
+
31
36
*``username`` - Username
32
37
*``password`` - Password
33
38
34
39
Include the following settings when using the `PAT` auth_method:
40
+
35
41
*``token`` - PAT token
36
42
37
43
If using the `oauth` auth_method, take a look at the OAuth section below for further setup instructions.
@@ -47,49 +53,74 @@ You can also use dynamic values from the datastore. See the
47
53
48
54
### Disclaimer
49
55
50
-
This documentation is written as of 06/17/2014. JIRA 6.3 implements OAuth1. Most of this doc would need to be revised when JIRA switches to OAuth2.
56
+
This documentation is written as of 06/17/2014.
57
+
Jira 6.3 implements OAuth1.
58
+
Most of this document would need to be revised when Jira switches to OAuth2.
51
59
52
60
### Steps
53
61
54
62
1. Generate RSA public/private key pair
55
-
```
56
-
# This will create a 2048 length RSA private key
57
-
$openssl genrsa -out mykey.pem 2048
58
-
```
59
-
60
-
```
61
-
# Now, create the public key associated with that private key
62
-
openssl rsa -in mykey.pem -pubout
63
-
```
64
-
2. Generate a consumer key. You can use python uuid.uuid4() to do this, for example:
65
-
66
-
```
67
-
$ python
68
-
Python 2.7.10 (default, Jul 30 2016, 19:40:32)
69
-
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
70
-
Type "help", "copyright", "credits" or "license" for more information.
71
-
>>> import uuid
72
-
>>> print uuid.uuid4()
73
-
210660f1-ca8a-40d5-a6ee-295ccbf3074d
74
-
>>>
75
-
```
76
-
77
-
3. Configure JIRA for external access:
78
-
* Go to AppLinks section of your JIRA - https://JIRA_SERVER/plugins/servlet/applinks/listApplicationLinks
79
-
* Create a Generic Application with some fake URL
80
-
* Click Edit, hit IncomingAuthentication. Plug in the consumer key and RSA public key you generated.
81
-
4. Get access token using this [script](https://github.com/lakshmi-kannan/jira-oauth-access-token-generator/blob/master/generate_access_token.py). You may need to install additional libraries to run that script, and you
82
-
will need to edit the script to use your file locations. Check the [README](https://github.com/lakshmi-kannan/jira-oauth-access-token-generator/blob/master/README.md) file for more information.
83
-
The access token is printed at the end of running that script. Save these keys somewhere safe.
84
-
5. 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.
63
+
64
+
```shell
65
+
$ openssl genrsa -out stackstorm-jira.pem 4096
66
+
```
67
+
68
+
2. Create the public key associated with that private key
69
+
70
+
```shell
71
+
$ openssl rsa -in stackstorm-jira.pem -pubout
72
+
```
73
+
74
+
3. Generate a consumer key. You can use python uuid.uuid4() to do this, for example:
75
+
76
+
```shell
77
+
$ python
78
+
Python 2.7.10 (default, Jul 30 2016, 19:40:32)
79
+
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
80
+
Type "help", "copyright", "credits" or "license"for more information.
81
+
>>> import uuid
82
+
>>> print uuid.uuid4()
83
+
210660f1-ca8a-40d5-a6ee-295ccbf3074d
84
+
>>>
85
+
```
86
+
87
+
4. Configure Jira for external access:
88
+
89
+
* Go to AppLinks section of your Jira at `https://{jira_server}/plugins/servlet/applinks/listApplicationLinks`
90
+
* Create a Generic Application with some fake URL
91
+
* Click Edit, choose IncomingAuthentication, plug in the consumer key and RSA public key you generated.
92
+
93
+
5. Get access token using this [script](https://github.com/lakshmi-kannan/jira-oauth-access-token-generator/blob/master/generate_access_token.py).
94
+
You may need to install additional libraries to run that script, and you will need to edit the script to use your file locations.
95
+
Check the [README](https://github.com/lakshmi-kannan/jira-oauth-access-token-generator/blob/master/README.md) file for more information.
96
+
The access token is printed at the end of running that script.
97
+
Save these keys somewhere safe.
98
+
99
+
6. Plug in the access token and access secret into the sensor or action.
100
+
You are good to make Jira calls.
101
+
Note: OAuth token expires.
102
+
You'll have to repeat the process based on the expiry date.
85
103
86
104
## Sensors
87
105
88
-
### JiraSensor
106
+
*``JiraSensor`` - Sensor which monitors JIRA for new tickets.
107
+
*``JiraSensorForAPIv2`` - Sensor which monitors JIRA for new tickets.
89
108
90
109
The sensor monitors for new tickets and sends a trigger into the system whenever there is a new ticket.
91
110
92
111
## Actions
93
112
94
-
* ``create_issue`` - Action which creates a new JIRA issue.
95
-
* ``get_issue`` - Action which retrieves details for a particular issue.
113
+
*``add_field_value`` - Add a field to a particular JIRA issue.
114
+
*``assign_issue`` - Assigning an issue to a user.
115
+
*``attach_file_to_issue`` - Attach a file to JIRA issue / ticket.
116
+
*``attach_files_to_issue`` - Attach multiple files to JIRA issue / ticket.
117
+
*``comment_issue`` - Comment on a JIRA issue / ticket.
118
+
*``create_issue`` - Create a new JIRA issue / ticket.
119
+
*``get_issue`` - Retrieve information about a particular JIRA issue.
120
+
*``get_issue_attachments`` - Retrieve attachments for a particular JIRA issue.
121
+
*``get_issue_comments`` - Retrieve comments for a particular JIRA issue.
122
+
*``link_issue`` - Link one JIRA issue to another JIRA issue.
123
+
*``search_issues`` - Search JIRA issues with a JQL query.
124
+
*``transition_issue`` - Do a transition on a JIRA issue / ticket.
125
+
*``transition_issue_by_name`` - Do a transition on a JIRA issue / ticket.
126
+
*``update_field_value`` - Update a field in a particular JIRA issue.
0 commit comments