AddComment
jiraAddComment
This step adds a comment on a particular issue.
Input
- idOrKey - Issue id or key.
- input - comment, supports jira wiki formatting.
- site - Optional, default:
JIRA_SITE
environment variable. - failOnError - Optional. default:
true
. - auditLog - Optional. default:
true
. Append a panel to the comment with the build url and build user name. - Deprecated: comment - comment, supports jira wiki formatting.
Output
- Each step generates generic output, please refer to this link for more information.
- The api response of this jira_add_comment 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 comment = [ body: 'test comment' ] jiraAddComment idOrKey: 'TEST-1', input: comment } }
-
withEnv
to override the default site (or if there is not global site)node { stage('JIRA') { withEnv(['JIRA_SITE=LOCAL']) { def comment = [ body: 'test comment' ] jiraAddComment idOrKey: 'TEST-1', input: comment } } }
-
Without environment variables.
def comment = [ body: 'test comment' ] jiraAddComment site: 'LOCAL', idOrKey: 'TEST-1', input: comment
-
With limited visibility.
def comment = [ body: 'test comment', visibility: [ type: 'role', value: 'Developer' ] ] jiraAddComment site: 'LOCAL', idOrKey: 'TEST-1', input: comment
-
Deprecated
jiraAddComment site: 'LOCAL', idOrKey: 'TEST-1', comment: 'test comment'