Search by Build
Entity Properties
The build to issue index is available as indexed issue entity properties that can be used in JQL when searching for issues, the following index attributes are available:
Attribute | JQL | Description |
---|---|---|
Worse job result | jenkinsWorstresult | String field containing the worst job result. From worst to best, UNKNOWN , ABORTED , NOT_BUILT , FAILURE , UNSTABLE , SUCCESS |
Total number of jobs linked | jenkinsTotal | Number field containing the total number of unique jobs. |
Total number of success jobs | jenkinsSuccess | Number field containing the total number of unique jobs where the last build was successful. |
Total number of unstable jobs | jenkinsUnstable | Number field containing the total number of unique jobs where the last build was unstable. |
Total number of failure jobs | jenkinsFailure | Number field containing the total number of unique jobs where the last build has failed. |
Total number of aborted jobs | jenkinsAborted | Number field containing the total number of unique jobs where the last build was aborted. |
Total number of not built jobs | jenkinsNotbuilt | Number field containing the total number of unique jobs where the last build was not built. |
Total number of unknown jobs | jenkinsUnknown | Number field containing the total number of unique jobs where the last build has an unknown result state. |
Find issues in project DEV that have a failing build
project = DEV AND jenkinsWorstresult = FAILURE ORDER BY priority DESC
Find issues in the project DEV that have non-successful builds
project = DEV AND jenkinsTotal > jenkinsSuccess ORDER BY priority DESC
JQL Functions
issuesRelatedToJob()
This function can be used to get all the issues that are related to the specified Jenkins Job. It only takes one argument, the Job name.
Examples
Search for issues related to the job ‘My Product’
issue in issuesRelatedToJob("My Product")
issuesRelatedToBuild()
This function can be used to get all the issues that are related to the specified build, and can be used in two ways:
- Only provide a single argument; search for issues related to a specific build identified by its
id
. - Provide two arguments; search for issues related to a specific build identified by the
job name
andbuild number
. - Provide three arguments; search for issues related to a range of builds identified by the
job name
rangestart
andend
build numbers.
Examples
Search for issues related to build 1234
issue in issuesRelatedToBuild(1234)
Search for issues related to build 1 of “My Product”
issue in issuesRelatedToBuild("My Product", 1)
Search for issues related to build 1 through 20 of “My Product”
issue in issuesRelatedToBuild("My Product", 1, 20)
Search for issues related to the last build of “My Product”
issue in issuesRelatedToBuild("My Product", lastBuild)