/
manifest.json
156 lines (156 loc) · 5.39 KB
/
manifest.json
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
"name": "ServiceNow",
"version": "1.0.0",
"overview": "Create feature flag change requests in ServiceNow.",
"description": "Efficiently comply with company-wide change management policies by embedding LaunchDarkly approvals into existing ServiceNow workflows.",
"author": "LaunchDarkly",
"supportEmail": "support@launchdarkly.com",
"links": {
"site": "https://www.servicenow.com/",
"launchdarklyDocs": "https://docs.launchdarkly.com/integrations/servicenow",
"privacyPolicy": "https://www.servicenow.com/privacy-statement.html"
},
"categories": ["approval"],
"icons": {
"square": "assets/images/servicenow-icon.svg",
"horizontal": "assets/images/servicenow-horizontal.svg"
},
"requiresOAuth": true,
"oauthIntegrationKey": "servicenow",
"formVariables": [],
"capabilities": {
"approval": {
"name": "ServiceNow",
"environmentFormVariables": [
{
"key": "template",
"name": "Standard change template",
"description": "The standard change template to be utilized for all flag changes in this environment.",
"type": "dynamicEnum",
"dynamicOptions": {
"endpoint": {
"url": "{{oauth.baseURI}}/api/sn_chg_rest/change/standard/template",
"method": "GET",
"headers": [
{
"name": "Authorization",
"value": "Bearer {{oauth.accessToken}}"
}
]
},
"parser": {
"optionsPath": "/result",
"optionsItems": {
"label": "/sys_name/display_value",
"value": "/sys_id/value"
}
}
}
},
{
"key": "detail_column",
"name": "Detailed information column name",
"description": "The name of the ServiceNow Change Request column used by LaunchDarkly to populate detailed approval request information.",
"type": "string",
"defaultValue": "justification",
"isOptional": true,
"placeholder": "justification"
}
],
"creationRequest": {
"endpoint": {
"url": "{{oauth.baseURI}}/api/sn_chg_rest/change/standard/{{environment.template}}",
"method": "POST",
"headers": [
{
"name": "Authorization",
"value": "Bearer {{oauth.accessToken}}"
}
]
},
"jsonBody": "{\"short_description\": \"{{{title.plainText}}}\", \"{{#if environmentFormVariables.detail_column}}{{environmentFormVariables.detail_column}}{{else}}justification{{/if}}\": \"{{_links.approval.href}}\\n\\n{{{details.plainText}}}\", \"requested_by\": \"{{{member.externalId}}}\", \"start_date\": \"{{timestamp.simple}}\", \"end_date\": \"{{formatWithOffset timestamp.milliseconds 301 'simple'}}\"}",
"parser": {
"approvalId": "/result/sys_id/value",
"statusValue": "/result/state/value",
"statusDisplay": "/result/state/display_value",
"approvalMatcher": "^-1",
"rejectionMatcher": "^4",
"urlTemplate": "{{oauth.baseURI}}/change_request.do?sys_id={{queryEncode context.approvalId}}"
}
},
"statusRequest": {
"endpoint": {
"url": "{{oauth.baseURI}}/api/sn_chg_rest/change/standard/{{context.approvalId}}",
"method": "GET",
"headers": [
{
"name": "Authorization",
"value": "Bearer {{oauth.accessToken}}"
}
]
},
"parser": {
"statusValue": "/result/state/value",
"statusDisplay": "/result/state/display_value",
"approvalMatcher": "^-1",
"rejectionMatcher": "^4"
}
},
"postApplyRequest": {
"endpoint": {
"url": "{{oauth.baseURI}}/api/sn_chg_rest/change/standard/{{context.approvalId}}?state=Review",
"method": "PATCH",
"headers": [
{
"name": "Authorization",
"value": "Bearer {{oauth.accessToken}}"
}
]
},
"parser": {
"statusValue": "/result/state/value",
"statusDisplay": "/result/state/display_value",
"approvalMatcher": "^-1",
"rejectionMatcher": "^4"
}
},
"deletionRequest": {
"endpoint": {
"url": "{{oauth.baseURI}}/api/sn_chg_rest/change/standard/{{context.approvalId}}?state=Canceled",
"method": "PATCH",
"headers": [
{
"name": "Authorization",
"value": "Bearer {{oauth.accessToken}}"
}
]
},
"parser": {
"statusValue": "/result/state/value",
"statusDisplay": "/result/state/display_value",
"approvalMatcher": "^-1",
"rejectionMatcher": "^4"
}
},
"memberListRequest": {
"endpoint": {
"url": "{{oauth.baseURI}}/api/now/table/sys_user?active=true&sysparm_fields=email,user_name",
"method": "GET",
"headers": [
{
"name": "Authorization",
"value": "Bearer {{oauth.accessToken}}"
}
]
},
"parser": {
"memberArrayPath": "/result",
"memberItems": {
"memberId": "/user_name",
"email": "/email"
}
}
}
}
}
}