JqlSearch
jiraJqlSearch
This step searches issues from the provided JIRA site by Jql.
Input
- jql - jql as a string.
- fields - Optional. the list of fields to return for each issue. default: null (in this case the parameter is not sent and all navigable fields are returned)
- site - Optional, default:
JIRA_SITE
environment variable. - failOnError - Optional. default:
true
.
Output
- Each step generates generic output, please refer to this link for more information.
- The api response of this jira_jql_search step can be reused later in your script by doing
response.data.required_field_name
. - You can see some example scenarios here
- All the available fields for a jira response can be found in JIRA API documentation depending on your JIRA version.
Examples
-
With default site from global variables.
node { stage('JIRA') { def issues = jiraJqlSearch jql: 'PROJECT = TEST' echo issues.data.toString() } }
-
withEnv
to override the default site (or if there is not global site)node { stage('JIRA') { withEnv(['JIRA_SITE=LOCAL']) { def issues = jiraJqlSearch jql: 'PROJECT = TEST' echo issues.data.toString() } } }
-
Without environment variables.
def issues = jiraJqlSearch jql: 'PROJECT = TEST', site: 'LOCAL', failOnError: true echo issues.data.toString()