Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58032

Not able to add comment during jiraTransitionIssue

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not A Defect
    • jira-steps-plugin
    • None
    • Jenkins version: CloudBees Jenkins Enterprise 2.138.4.3-rolling

    Description

      I have got following message while run jenkins pipeline to update Jira status

      jiraTransitionIssue idOrKey: 'Test-28', input: [
                  transition: [
                      id: '1291'
                  ], 
                  comment: [ body: 'test comment' ]
              ]
      

       

      Error Code: 400
      Error Message: {"errorMessages":[],"errors":{"comment":"Please provide a comment for this transition"}}
      [
      

      Attachments

        Activity

          The error message is from JIRA itself, based on the JIRA version you need to make sure that the input is changed so that it works correct, there is nothing we can do in this plugin to fix this.

          nrayapati Naresh Rayapati added a comment - The error message is from JIRA itself, based on the JIRA version you need to make sure that the input is changed so that it works correct, there is nothing we can do in this plugin to fix this.

          Per the latest API docs the structure is bit different from what you are trying to send here.

          https://docs.atlassian.com/software/jira/docs/api/REST/8.2.2/#api/2/issue-doTransition

          nrayapati Naresh Rayapati added a comment - Per the latest API docs the structure is bit different from what you are trying to send here. https://docs.atlassian.com/software/jira/docs/api/REST/8.2.2/#api/2/issue-doTransition
          yhjhoo Yang Huajie added a comment -

          Yes, you are right. I switched to use jira API directly to make it work. Any chance to make the plugin to support the latest API?

          yhjhoo Yang Huajie added a comment - Yes, you are right. I switched to use jira API directly to make it work. Any chance to make the plugin to support the latest API?
          martensd David added a comment -

          Try

          jiraTransitionIssue idOrKey: 'Test-28', input: [
                      transition: [
                          id: '1291'
                      ], 
                      comment: [add: [ body: 'test comment' ]]
                  ]
          

          The API is calling for an add after the comment.

          martensd David added a comment - Try jiraTransitionIssue idOrKey: 'Test-28' , input: [ transition: [ id: '1291' ], comment: [add: [ body: 'test comment' ]] ] The API is calling for an add after the comment.

          I am also receiving this same error when trying to transition a Jira issue with a comment. David's suggestion does not work.

          nrayapati , are there any resources with examples showing correct syntax for including a comment when using jiraTransitionIssue?

          ctremmel Clayton Tremmel added a comment - I am also receiving this same error when trying to transition a Jira issue with a comment. David's suggestion does not work. nrayapati , are there any resources with examples showing correct syntax for including a comment when using jiraTransitionIssue?

          People

            nrayapati Naresh Rayapati
            yhjhoo Yang Huajie
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: