-
Notifications
You must be signed in to change notification settings - Fork 26
/
jira-update-issue-sink.kamelet.yaml
137 lines (126 loc) · 6.88 KB
/
jira-update-issue-sink.kamelet.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: jira-update-issue-sink
annotations:
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "2.3.0"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjU2cHgiIGhlaWdodD0iMjU2cHgiIHZpZXdCb3g9IjAgMCAyNTYgMjU2IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIj4KICAgIDxkZWZzPgogICAgICAgIDxsaW5lYXJHcmFkaWVudCB4MT0iOTguMDMwODY3NSUiIHkxPSIwLjE2MDU5OTU3MiUiIHgyPSI1OC44ODc3MDYyJSIgeTI9IjQwLjc2NTUyNDYlIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiMwMDUyQ0MiIG9mZnNldD0iMTglIj48L3N0b3A+CiAgICAgICAgICAgIDxzdG9wI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ition:
title: "Jira Update Issue Sink"
description: |-
Update fields of an existing issue in Jira.
The Kamelet expects the following headers to be set:
- `issueKey` / `ce-issueKey`: as the issue code in Jira.
- `issueTypeName` / `ce-issueTypeName`: as the name of the issue type (example: Bug, Enhancement).
- `issueSummary` / `ce-issueSummary`: as the title or summary of the issue.
- `issueAssignee` / `ce-issueAssignee`: as the user assigned to the issue (Optional).
- `issuePriorityName` / `ce-issuePriorityName`: as the priority name of the issue (example: Critical, Blocker, Trivial) (Optional).
- `issueComponents` / `ce-issueComponents`: as list of string with the valid component names (Optional).
- `issueDescription` / `ce-issueDescription`: as the issue description (Optional).
The issue description can be set from the body of the message or the `issueDescription`/`ce-issueDescription` in the header, however the body takes precedence.
To authenticate a username/password or personal token must be defined. We recommend to use personal token as it is a safer way to get access to Jira.
required:
- jiraUrl
type: object
properties:
jiraUrl:
title: Jira URL
description: The URL of your instance of Jira
type: string
example: http://my_jira.com:8081
username:
title: Username
description: The username to access Jira
type: string
x-descriptors:
- urn:camel:group:credentials
password:
title: Password
description: The password to access Jira
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
personal-token:
title: Personal Token
description: Personal Token
type: string
x-descriptors:
- urn:camel:group:credentials
types:
in:
mediaType: application/json
dependencies:
- "camel:core"
- "camel:jackson"
- "camel:jira"
- "camel:kamelet"
- "mvn:com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.5"
template:
from:
uri: "kamelet:source"
steps:
- choice:
when:
- simple: "${header[ce-issueKey]}"
steps:
- set-header:
name: issueKey
simple: "${header[ce-issueKey]}"
- choice:
when:
- simple: "${header[ce-issueTypeName]}"
steps:
- set-header:
name: issueTypeName
simple: "${header[ce-issueTypeName]}"
- choice:
when:
- simple: "${header[ce-issueSummary]}"
steps:
- set-header:
name: issueSummary
simple: "${header[ce-issueSummary]}"
- choice:
when:
- simple: "${header[ce-issueAssignee]}"
steps:
- set-header:
name: issueAssignee
simple: "${header[ce-issueAssignee]}"
- choice:
when:
- simple: "${header[ce-issuePriorityName]}"
steps:
- set-header:
name: issuePriorityName
simple: "${header[ce-issuePriorityName]}"
- choice:
when:
- simple: "${header[ce-issueComponents]}"
steps:
- set-header:
name: issueComponents
simple: "${header[ce-issueComponents]}"
- choice:
when:
- simple: "${header[ce-issueDescription]}"
steps:
- set-header:
name: issueDescription
simple: "${header[ce-issueDescription]}"
- to:
uri: "jira:UpdateIssue"
parameters:
jiraUrl: "{{jiraUrl}}"
username: "{{?username}}"
password: "{{?password}}"
access-token: "{{?personal-token}}"