Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

Plugin Information

View JIRA Pipeline Steps on the plugin site for more information.

Jenkins Pipeline Steps for integration with JIRA

More information about this plugin is available here.

Quick links:

Changelog

13 Comments

  1. Unknown User (neybar)

    I am trying to automate setup for this plugin.  I'm wondering two things:

    1. Using init.goovy.d I'd like to update the global settings for this plugin.  For example to setup the slack plugin I'm doing something similar to this https://github.com/samrocketman/jenkins-bootstrap-slack/blob/master/scripts/configure-slack.groovy  
    2. I'd like to be able to use the Jenkins credentials subsystem to store username/password.  The global settings for jira-steps doesn't know how to handle that.  Is there a way to pass in the credentials directly to a call?  Eg:  

      withCredentials('foo', passwordVariable: 'password', usernameVariable: 'username')) {
          def component = jiraGetComponent username: username, password: password, site: 'LOCAL', id: '10024', failOnError: false
      }

  2. Unknown User (nrayapati)

    Missed this comment, as I didn't get any notification about this. Not sure if we get some notifications at all, but in future I would log a JIRA to get more faster response. 

     

    I haven't tried this, but you should able to use https://github.com/jenkinsci/jira-steps-plugin/blob/master/src/main/java/org/thoughtslive/jenkins/plugins/jira/Site.java class similar to what has done with slack plugin. 

    And also I will enhancement to consider reading credentials from jenkins subsystem, I had to choose this initially to support the oauth type.

  3. Unknown User (sag47)

    James, you're mixing apples and oranges.  The configure-slack.groovy script is a script console script only able to be run by Jenkins administrators. withCredentials is a feature of Jenkins pipeline scripts.  They are completely different.

    In any case, I have contributed an example for you: https://github.com/jenkinsci/jira-steps-plugin/pull/48

  4. Unknown User (anthonymastrean)

    Has anyone used this plugin to connect to JIRA cloud at https://atlassian.net? I'm having trouble authenticating... not sure if I basic auth is supposed to work or if I need an API token (can't seem to generate these). 

    (sad)

    1. Unknown User (nrayapati)

      Looks like JIRA cloud uses the same authentication methods as hosted instance, so there shouldn't be any difference and I am not aware of if anyone using this plugin against cloud, nice if you can share your experiences with it. (smile) 

      https://docs.atlassian.com/jira/REST/cloud/

      1. Unknown User (anthonymastrean)

        OK, the problem seemed to be on my end. I tried the simplest thing that could have worked and reset my password. I think something was funny because I had initially logged in with my Google account. Once I reset my password, we were set. I could do basic auth... although, I don't like using my personal credentials for integrations like this.

  5. Unknown User (rudy_mu)

    Hi guys,

    I'm trying to connect to HTTPS JIRA site but it shows an error (Failed to Basic login to JIRA)

    but if it only HTTP it works fine. Any idea why ? this is all about Basic Authentification

    Thanks

    1. Unknown User (nrayapati)

      Probably I think something to do with the JIRA side setup? not sure why it doesn't work unless. 

  6. Unknown User (t3knoid)

    How can I get a list of JIRA sites from the configuration using groovy?

    1. Unknown User (t3knoid)

      I took a stab at this and this is how far I got. I want to be able to get the URL  of a given site however.

      import org.thoughtslive.jenkins.plugins.jira.Config;
      import org.thoughtslive.jenkins.plugins.jira.Site;
      Site[] sites = Config.DESCRIPTOR.getSites()
      sites.each { site ->
      echo site.getName()
      }
      1. Unknown User (nrayapati)

  7. Unknown User (jackiemoon3)

    On the homepage of the documentation, https://jenkinsci.github.io/jira-steps-plugin/, it gives an example:

    def transitionInput = [ transition: [ name: 'Close'] ]
    jiraTransitionIssue idOrKey: 'RELEASE-999', input: transitionInput, site: 'YOURJIRASITE'

    Has anyone actually got this to work? It's only ingesting Ids not names from my attempts:

    Error Message: {"errorMessages":["'transition' identifier must be an integer"],"errors":{}}

    Not as convenient having to use Ids

    1. Unknown User (jackiemoon3)

      Created a function instead to do this... Allows author to write the Name of the Transition instead of using Ids so that readers will know what the user is trying to accomplish



      def transition_issue_status(issueKey, status) {
          def transitions = jiraGetIssueTransitions idOrKey: "${issueKey}"
          def transition_temp
          for (item in transitions.data.transitions) {
              if(item.name.toLowerCase() == status.toLowerCase()) {
                  echo "Transitioning issue to ${item.name} w/ id: ${item.id}"
                  transition_temp = [ transition: [ id: "${item.id}"] ]
                  jiraTransitionIssue idOrKey: "${issueKey}", input: transition_temp
              }
          }
          if (transition_temp != null) {
              return
          }
          else {
              echo "Invalid transition supplied: ${status}. Defaulting to Incomplete..."
              def transitionInput_incomplete_func = [ transition: [ id: '261'] ]
              jiraTransitionIssue idOrKey: "${issueKey}", input: transitionInput_incomplete_func
              currentBuild.result = 'FAILURE'
              error("Build failed due to improper transitions.")
          }
      }
      
      
      #call function in pipeline
      ticketid = response.data.key.toString()
      transition_issue_status(ticketid, 'Build')