提问人:Mohankanth 提问时间:11/6/2023 最后编辑:Mohankanth 更新时间:11/6/2023 访问量:30
每当测试用例失败时,使用 jenkins 管道在 JIRA 中创建问题或 bug
Create a issue or bug in JIRA using jenkins pipeline whenever test cases fails
问:
我尝试了多种方法使用 Jenkins 管道在 JIRA 中创建任务或错误,但它不起作用。它不显示任何有关 jira 事务创建的日志。请帮帮我
pipeline {
agent any
stages {
stage('Build and Test') {
steps {
// Build your project and run tests, generate XML test report
}
}
stage('Publish JUnit Test Results') {
steps {
// Publish JUnit test results
junit 'core/target/surefire-reports/*.xml'
}
}
stage('Create Jira Issues') {
steps {
// Use the JiraTestResultReporter to create Jira issues
jiraTestResultReporter(
configs: [
jiraStringField(fieldKey: 'summary', value: 'Issue from Jenkins'),
jiraStringField(fieldKey: 'description', value: 'Issue from Jenkins'),
jiraStringArrayField(fieldKey: 'labels', values: ['Jenkins', 'Integration'])
],
projectKey: 'JiraKey',
issueType: 'Task',
autoRaiseIssue: true,
autoResolveIssue: false,
autoUnlinkIssue: false
)
}
}
}
}
答: 暂无答案
评论