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

On "review" pipelines, I'd like to get a P4ChangeSet (or change) that I can resolve a username/email address from

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin
    • None
    • Jenkins Controller with Agents running on Linux, Mac and Windows.

      I recently was able to resolve a list of slack usernames from a the build's current changeset, but for a review build, I'd like to be able to notify via slack the current author of the review change. Is there a way I can obtain a P4Change from currentBuild that says this is the shelved change list?

      @NonCPS
      def getSlackUsers(changesets) {
          def resolver = new jenkins.plugins.slack.user.EmailSlackUserIdResolver(
              "${env.BOT_CRED_PSW}",       
              jenkins.plugins.slack.HttpClient.getCloseableHttpClient(null))
          resolver.setMailAddressResolvers(hudson.tasks.MailAddressResolver.all())
          return resolver.resolveUserIdsForChangeLogSets(currentBuild.getChangeSets()).collect { "<@$it>" }.join(' ')
      }
      

            Unassigned Unassigned
            enaess Eivind
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: