|
1 | 1 | # Jira
|
2 | 2 |
|
3 |
| -Integration to import information from Jira into Port. |
| 3 | +An integration used to import Jira resources into Port. |
4 | 4 |
|
5 |
| -The integration supports importing issues and projects from your Jira cloud account to Port, according to your mapping and definition. |
| 5 | +#### Install & use the integration - [Integration documentation](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/project-management/jira) |
6 | 6 |
|
7 |
| -**Note:** the integration supports Jira Cloud at the moment, support for Jira Server is being worked on. |
8 |
| - |
9 |
| -## Development Requirements |
10 |
| - |
11 |
| -- Python3.11.0 |
12 |
| -- Poetry (Python Package Manager) |
13 |
| -- Port-Ocean |
14 |
| - |
15 |
| -## Deployment to Port |
16 |
| - |
17 |
| -For more information about the installation visit the [Port Ocean helm chart](https://github.com/port-labs/helm-charts/tree/main/charts/port-ocean) |
18 |
| - |
19 |
| -```bash |
20 |
| -# The following script will install an Ocean integration in your K8s cluster using helm |
21 |
| -# integration.identifier: Change the identifier to describe your integration |
22 |
| -# integration.config.appHost: The host of the Port Ocean app. Used to set up the integration endpoint as the target for Webhooks created in Jira |
23 |
| -# integration.config.jiraHost: The URL of your Jira, for example: https://example.atlassian.net |
24 |
| -# integration.secrets.atlassianUserEmail: The email of the user used to query Jira |
25 |
| -# integration.secrets.atlassianUserToken: Jira API token generated by the user specified under atlassianUserEmail |
26 |
| -# ingress.annotations."nginx\.ingress\.kubernetes\.io/rewrite-target": Change the annotation value and key to match your ingress controller |
27 |
| - |
28 |
| -helm upgrade --install my-jira-integration port-labs/port-ocean \ |
29 |
| - --set port.clientId="CLIENT_ID" \ |
30 |
| - --set port.clientSecret="CLIENT_SECRET" \ |
31 |
| - --set initializePortResources=true \ |
32 |
| - --set integration.identifier="my-jira-integration" \ |
33 |
| - --set integration.type="jira" \ |
34 |
| - --set integration.eventListener.type="POLLING" \ |
35 |
| - --set integration.config.appHost="https://example.com" \ |
36 |
| - --set integration.config.jiraHost="https://example.atlassian.net" \ |
37 |
| - --set integration.secrets.atlassianUserEmail= "[email protected]" \ |
38 |
| - --set integration.secrets.atlassianUserToken="<JIRA_API_TOKEN>" \ |
39 |
| - --set ingress.enabled=true \ |
40 |
| - --set ingress.annotations."nginx\.ingress\.kubernetes\.io/rewrite-target"= / |
41 |
| -``` |
42 |
| - |
43 |
| -## Supported Kinds |
44 |
| - |
45 |
| -### Project |
46 |
| - |
47 |
| -The mapping should refer to one of the projects from the example response: [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-search-get) |
48 |
| - |
49 |
| -<details> |
50 |
| -<summary>blueprints.json</summary> |
51 |
| - |
52 |
| -```json |
53 |
| -{ |
54 |
| - "identifier": "project", |
55 |
| - "title": "Jira Project", |
56 |
| - "icon": "Jira", |
57 |
| - "description": "A Jira project", |
58 |
| - "schema": { |
59 |
| - "properties": { |
60 |
| - "url": { |
61 |
| - "title": "Project URL", |
62 |
| - "type": "string", |
63 |
| - "format": "url", |
64 |
| - "description": "URL to the project in Jira" |
65 |
| - } |
66 |
| - } |
67 |
| - } |
68 |
| -} |
69 |
| -``` |
70 |
| - |
71 |
| -</details> |
72 |
| -<details> |
73 |
| - <summary>port-app-config.yaml</summary> |
74 |
| - |
75 |
| -```yaml |
76 |
| -createMissingRelatedEntities: true |
77 |
| -deleteDependentEntities: true |
78 |
| -resources: |
79 |
| - - kind: project |
80 |
| - selector: |
81 |
| - query: "true" |
82 |
| - port: |
83 |
| - entity: |
84 |
| - mappings: |
85 |
| - identifier: .key |
86 |
| - title: .name |
87 |
| - blueprint: '"project"' |
88 |
| - properties: |
89 |
| - url: (.self | split("/") | .[:3] | join("/")) + "/projects/" + .key |
90 |
| -``` |
91 |
| -
|
92 |
| -</details> |
93 |
| -
|
94 |
| -### Issue |
95 |
| -
|
96 |
| -The mapping should refer to one of the issues in the example response: [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-get) |
97 |
| -
|
98 |
| -<details> |
99 |
| -<summary>blueprints.json</summary> |
100 |
| -
|
101 |
| -```json |
102 |
| -{ |
103 |
| - "identifier": "issue", |
104 |
| - "title": "Jira Issue", |
105 |
| - "icon": "Jira", |
106 |
| - "schema": { |
107 |
| - "properties": { |
108 |
| - "url": { |
109 |
| - "title": "Issue URL", |
110 |
| - "type": "string", |
111 |
| - "format": "url", |
112 |
| - "description": "URL to the issue in Jira" |
113 |
| - }, |
114 |
| - "status": { |
115 |
| - "title": "Status", |
116 |
| - "type": "string", |
117 |
| - "description": "The status of the issue" |
118 |
| - }, |
119 |
| - "issueType": { |
120 |
| - "title": "Type", |
121 |
| - "type": "string", |
122 |
| - "description": "The type of the issue" |
123 |
| - }, |
124 |
| - "components": { |
125 |
| - "title": "Components", |
126 |
| - "type": "array", |
127 |
| - "description": "The components related to this issue" |
128 |
| - }, |
129 |
| - "assignee": { |
130 |
| - "title": "Assignee", |
131 |
| - "type": "string", |
132 |
| - "format": "user", |
133 |
| - "description": "The user assigned to the issue" |
134 |
| - }, |
135 |
| - "reporter": { |
136 |
| - "title": "Reporter", |
137 |
| - "type": "string", |
138 |
| - "description": "The user that reported to the issue", |
139 |
| - "format": "user" |
140 |
| - }, |
141 |
| - "creator": { |
142 |
| - "title": "Creator", |
143 |
| - "type": "string", |
144 |
| - "description": "The user that created to the issue", |
145 |
| - "format": "user" |
146 |
| - } |
147 |
| - } |
148 |
| - }, |
149 |
| - "relations": { |
150 |
| - "project": { |
151 |
| - "target": "project", |
152 |
| - "title": "Project", |
153 |
| - "description": "The Jira project that contains this issue", |
154 |
| - "required": false, |
155 |
| - "many": false |
156 |
| - }, |
157 |
| - "parentIssue": { |
158 |
| - "target": "issue", |
159 |
| - "title": "Parent Issue", |
160 |
| - "required": false, |
161 |
| - "many": false |
162 |
| - }, |
163 |
| - "subtasks": { |
164 |
| - "target": "issue", |
165 |
| - "title": "Subtasks", |
166 |
| - "required": false, |
167 |
| - "many": true |
168 |
| - } |
169 |
| - } |
170 |
| -} |
171 |
| -``` |
172 |
| - |
173 |
| -</details> |
174 |
| -<details> |
175 |
| - <summary>port-app-config.yaml</summary> |
176 |
| - |
177 |
| -```yaml |
178 |
| -createMissingRelatedEntities: true |
179 |
| -deleteDependentEntities: true |
180 |
| -resources: |
181 |
| - - kind: issue |
182 |
| - selector: |
183 |
| - query: "true" |
184 |
| - port: |
185 |
| - entity: |
186 |
| - mappings: |
187 |
| - identifier: .key |
188 |
| - title: .fields.summary |
189 |
| - blueprint: '"issue"' |
190 |
| - properties: |
191 |
| - url: (.self | split("/") | .[:3] | join("/")) + "/browse/" + .key |
192 |
| - status: .fields.status.name |
193 |
| - issueType: .fields.issuetype.name |
194 |
| - components: .fields.components |
195 |
| - assignee: .fields.assignee.displayName |
196 |
| - reporter: .fields.reporter.displayName |
197 |
| - creator: .fields.creator.displayName |
198 |
| - relations: |
199 |
| - project: .fields.project.key |
200 |
| - parentIssue: .fields.parent.key |
201 |
| - subtasks: .fields.subtasks | map(.key) |
202 |
| -``` |
203 |
| -
|
204 |
| -You can add a [JQL](https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/) query to the Jira issues ingest process, add a `jql` key to the `selector` section to perform the filtering. |
205 |
| - |
206 |
| -For example: |
207 |
| - |
208 |
| -```yaml |
209 |
| -resources: |
210 |
| - - kind: issue |
211 |
| - selector: |
212 |
| - query: "true" |
213 |
| - jql: "issueKey=EXAMPLE-1234" |
214 |
| -``` |
215 |
| - |
216 |
| -</details> |
217 |
| - |
218 |
| -## Development |
219 |
| - |
220 |
| -### Installation |
221 |
| - |
222 |
| -```sh |
223 |
| -make install |
224 |
| -``` |
225 |
| - |
226 |
| -### Runnning Localhost |
227 |
| - |
228 |
| -```sh |
229 |
| -make run |
230 |
| -``` |
231 |
| - |
232 |
| -or |
233 |
| - |
234 |
| -```sh |
235 |
| -ocean sail |
236 |
| -``` |
237 |
| - |
238 |
| -### Running Tests |
239 |
| - |
240 |
| -`make test` |
241 |
| - |
242 |
| -### Access Swagger Documentation |
243 |
| - |
244 |
| -> <http://localhost:8080/docs> |
245 |
| - |
246 |
| -### Access Redoc Documentation |
247 |
| - |
248 |
| -> <http://localhost:8080/redoc> |
249 |
| - |
250 |
| -### Folder Structure |
251 |
| - |
252 |
| -The Jira integration suggested folder structure is as follows: |
253 |
| - |
254 |
| -``` |
255 |
| -Jira/ |
256 |
| -├─ main.py |
257 |
| -├─ pyproject.toml |
258 |
| -└─ Dockerfile |
259 |
| -``` |
| 7 | +#### Develop & improve the integration - [Ocean integration development documentation](https://ocean.getport.io/develop-an-integration/) |
0 commit comments