Commits
63 63 | } |
64 64 | |
65 65 | if (fileExists("cucumber/target/report.json")) { |
66 66 | step([$class: 'XrayImportBuilder', |
67 67 | serverInstance: '89d8e9d1-8aff-4f28-8830-5d1217f0d789', |
68 68 | projectKey: 'NRT', |
69 69 | endpointName: '/cucumber', |
70 70 | importFilePath: 'cucumber/target/report.json', |
71 71 | importToSameExecution: 'true' |
72 72 | ]) |
73 + | def log = currentBuild.rawBuild.getLog(2000000) |
74 + | def pattern = /"testExecIssue":\{"id":"(\d+)","key":"[^"]+","self":"([^"]+)"\}/ |
75 + | |
76 + | def testExecIssueSelfLink |
77 + | for (String line : log) { |
78 + | def matcher = (line =~ pattern) |
79 + | if (matcher.find()) { |
80 + | testExecIssueSelfLink = matcher.group(2) //issue link |
81 + | break |
82 + | } |
83 + | } |
84 + | if(testExecIssueSelfLink != null){ |
85 + | withCredentials([[$class: 'UsernamePasswordMultiBinding', |
86 + | credentialsId: "bb69c5ba-a22f-44e7-99fa-07f1975fa9a2", |
87 + | usernameVariable: 'USER', |
88 + | passwordVariable: 'PASSWORD']]) { |
89 + | |
90 + | def now = new Date().format("dd/MM/yyyy HH:mm", TimeZone.getTimeZone('CET')) |
91 + | sh(script: """curl -X PUT "${testExecIssueSelfLink}" -H "Content-Type: application/json" -u "${USER}:${PASSWORD}" -d '{"fields": {"summary": "${env.JOB_NAME} - ${now}"}}'""", returnStdout: true) |
92 + | } |
93 + | } |
73 94 | } |
74 95 | } |
75 96 | stage ('Clean') { |
76 97 | deleteDir() |
77 98 | } |
78 99 | } |
79 100 | } |
80 101 | |