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

Missing DSL for traits

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Same as JENKINS-48336 and JENKINS-48337, traits is not implemented to be used with DSL.

      Workaround is to use configure blocks:

      configure { organizationFolder ->
              organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.BranchDiscoveryTrait'{
                  strategyId('3')
              }
          }
          configure { organizationFolder ->
              organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.OriginPullRequestDiscoveryTrait'{
                  strategyId('2')
              }
          }
          configure { organizationFolder ->
              organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait'{
              strategyId('2')
              }
          }
          configure { organizationFolder ->
              organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.SSHCheckoutTrait'{
                  credentialsId('my_id')
              }
          }
          configure { organizationFolder ->
              organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.WebhookRegistrationTrait'{
                  mode('DISABLE')
              }
          }
      

        Attachments

          Issue Links

            Activity

            ncosta Nuno Costa created issue -
            daspilker Daniel Spilker made changes -
            Field Original Value New Value
            Link This issue duplicates JENKINS-45860 [ JENKINS-45860 ]
            daspilker Daniel Spilker made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]
            daspilker Daniel Spilker made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              Assignee:
              daspilker Daniel Spilker
              Reporter:
              ncosta Nuno Costa
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: