· 6 years ago · Oct 21, 2019, 07:42 PM
1import groovyx.net.http.RESTClient
2import static groovyx.net.http.ContentType.*
3
4def client = new RESTClient( 'https://tc-msk-jira-test.telecontact.ru/rest/api/2/issue/' )
5def resp = client.post(
6 headers: [
7 'Content-Type': 'application/json',
8 'x-api-key': 'Xr4A4nZ2g23BcvJ1V9UgsPcHI8oJFmQn'
9 ],
10 path : 'notifications/jira-create',
11 body : [
12 fields: [
13 project: [
14 key: "TEST"
15 ],
16 summary: "REST ye merry gentlemen.",
17 description: "Creating of an issue using project keys and issue type names using the REST API",
18 issuetype: [
19 name: "Task"
20 ]
21 ]
22 ],
23 requestContentType : JSON
24)