anchor.diff:  ----
   
   [[dsl-usecases-security-account-group-permissions]]
  -===== Account group permissions
  +==== Account group permissions
   
   To give a role to an account group:
   
  
positive.code: ----
  
  [[dsl-usecases-security-account-groups]]
  ===== Management of account groups
  
  To add or update an account group:
  
  
negative.code: def promotionLevel = ontrack.promotionLevel('project', 'branch', 'COPPER')
  file.bytes = promotionLevel.image.content
  ----
  
  [[dsl-usecases-changelogs]]
  === DSL Change logs
  
  When a branch is configured for a SCM (Git, Subversion), a
  <<changelogs,change log>> can be computed between two builds and following
  collections can be displayed:
  
  * revisions or commits
  * issues
  * file changes
  
  TIP: Change logs can also be computed between builds which belong to different
       branches, as long as they are in the same project. _This is only
       supported for Git, not for Subversion._
  
  [[dsl-usecases-changelogs-get]]
  ==== Getting the change log
  
  Given two builds, one gets access to the change log using:
  
  [source,groovy]
  ----
  def build1 = ontrack.build('proj', 'master', '1')
  def build2 = ontrack.build('proj', 'master', '2')
  
  def changelog = build1.getChangeLog(build2)
  ----
  
  NOTE: The returned change log might be `null` if the project and branches are
        not correctly configured.
  
  On the returned `ChangeLog` object, one can access commits, issues and file
  changes.
  
  [[dsl-usecases-changelogs-commits]]
  ==== Commits
  
  The list of commits can be accessed using the `commits` property:
  
  [source,groovy]
  ----
  changeLog.commits.each {
      println "* ${it.shortId} ${it.message} (${it.author} at ${it.timestamp})"
  }
  ----
  
  Each item in the `commits` collection has the following properties:
  
  * `id` - identifier, revision or commit hash
  * `shortId` - short identifier, revision or abbreviated commit hash
  * `author` - name of the committer
  * `timestamp` - ISO date for the commit time
  * `message` - raw message for the commit
  * `formattedMessage` - HTML message with links to the issues
  * `link` - link to the commit
  
  NOTE: This covers only the common attributes provided by Ontrack - additional
        properties are also available for a specific SCM.
  
  [[dsl-usecases-changelogs-issues]]
  ==== Issues
  
  The list of issues can be accessed using the `issues` property:
  
  [source,groovy]
  ----
  changeLog.issues.each {
      println "* ${it.displayKey} ${it.status} ${it.summary}"
  }
  ----
  
  Each item in the `issues` collection has the following properties:
  
  * `key` - identifier, like `1`
  * `displayKey` - display key (like `#1`)
  * `summary` - short title for the issue
  * `status` - status of the issue
  * `url` - link to the issue
  
  NOTE: This covers only the common attributes provided by Ontrack - additional
        properties are also available for a specific issue service.
  
  [[dsl-usecases-changelogs-export]]
  ==== Exporting the change log
  
  The change log can also be exported as text (HTML and Markdown are also
  available):
  
  [source,groovy]
  ----
  String text = changeLog.exportIssues(
          format: 'text',
          groups: [
                  'Bugs'        : ['defect'],
                  'Features'    : ['feature'],
                  'Enhancements': ['enhancement'],
          ],
          exclude: ['design', 'delivery']
  )
  ----
  
  * `format` can be one of `text` (default), `html` or `markdown`
  * `groups` allows to group issues per type. If not defined, no grouping is done
  * `exclude` defines the types of issues to not include in the change log
  * `altGroup` defaults to _Other_ and is the name of the group where remaining
     issues do not fit.
  
  [[dsl-usecases-changelogs-files]]
  ==== File changes
  
  The list of file changes can be accessed using the `files` property:
  
  [source,groovy]
  ----
  changeLog.files.each {
      println "* ${it.path} (${it.changeType})"
  }
  ----
  
  Each item in the `files` collection has the following properties:
  
  * `path` - path changed
  * `changeType` - nature of the change
  * `changeTypes` - list of changes on this path
  
  NOTE: This covers only the common attributes provided by Ontrack - additional
        properties are also available for a specific SCM.
  