Vadym
Vadym

Reputation: 411

Groovy: extract ticket id created by the X-Ray Jenkins plugin

I have a Groovy pipeline that utilizes the X-Ray Jenkins plugin to import test results to Jira:

step([$class: 'XrayImportBuilder', endpointName: '/multipart', importFilePath: 'result.json', importInfo: 'info.json', inputInfoSwitcher: 'filePath', serverInstance: 'my-server-instance-value'])

It works fine, but doesn't return any value that could help me to determine the created ticket id.

Once this step is called, the plugin logs the all the data (including the ticket id) as the logged output, but I can't access the runtime logs using Groovy methods (e. g. getLogFile, etc.) since it's limited by the Jenkins admin (I can't change that policy just for retrieving the ticket id).

Is there any other way to get that output or ticket id or anything that points to the created ticket in Jira?

Upvotes: 0

Views: 69

Answers (1)

Sérgio
Sérgio

Reputation: 2129

Currently, that seems to not be possible, at least in a direct way. The Xray Jenkins plugin supports setting up environment variables based on the output (coming from the Xray REST API) but unfortunately it doesn't support pipeline projects.

Upvotes: 1

Related Questions