Uploaded image for project: 'Automation for Cloud'
  1. Automation for Cloud
  2. AUTO-473

[Jira API constraint] More ways to work with issue changelog - allow easy access to issue changelog for determining things like how long an issue has been in the current status, make previous status available for action to rollback a field value

    XMLWordPrintable

Details

    • 1
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Currently, there is limited changelog access.

      • Many customers report being unable to trigger rule when an epic is updated or an issue is added to an epic

      It would be good to expose some extra properties such as issue.status.changed which looks at the changelog to determine how long the issue has been in this status for. It could also be extended to other fields like assignee as well, or triggering when an epic is changed.

      We could probably take this further and expose other useful properties as well.

      You should be able to:

      • iterate overall fields that have changed
      • Each entry should contain
        • Field name, id
        • A diff string
        • changed values
        • Added values
        • removed values
        • Each value should contain changeLog & changeLogString
        • If we can resolve to real objects - e.g. user we should give them access to that

      #changelog formula doesn't work with Components and Fix Version fields -

      It looks like that #changelog formula doesn't work with Components and Fix Version fields. I assumed that that could be a problem with list fields but it works well for Labels. Also, other fields with #changelog work properly.
      Formulas I was trying to use in my notifications, which don't work were:

      {{#changelog.fixVersions}} Fix Version has changed from "{{fromString}}" to"{{toString}}"{{/changelog.fixVersions}}

      Result: Fix Version has changed from "" to ""

      {{#changelog.component}} Components was removed "{{fromString}}" Component was added "{{toString}}" {{/changelog.component}}

      Result: Components was removed "" Component was added ""
      I also tried to use fixVersion.name or #changelog.fixVersionsvalue but it didn't help.

      Workaround: Not available at the moment.


      Docs Improvement for changelog smart-value - Mustache .

      When trying to find all the contents of a changelog, it appears that Mustache supports the special {{{{ . }}}} to represent the top item of the stack, but when you try to save a rule with this value, you get this error message:

      "Error parsing template: Improperly closed variable" when using . in Log Action and trying to save rule

      see more here: https://github.com/mustache/spec/blob/master/specs/interpolation.yml#L7-L9

      Works fine for a multi-line comment and with #debug so I've been able to work around this.

      We should document that this is available for troubleshooting purposes to help understand how the changelog smart-value works.


      Make previous status available to actions/conditions so that we can revert a transition (action to rollback a field value) -

      It would be nice to be able to peek back in time to see the immediately previous status of an issue.

      Access via: issue.status.previous.name
      or maybe something different.

      This allows users to "revert last transition" more easily. You can do this for transitions that change the status by using

      {{#changelog.status}}{{from}}{{/}}

      Need to look at the changelogs for the last status change and attempt to transition to that status and fail if no status change or transitions can be found


      You may want to revert a field to its original value if a certain condition is not met. (e.g. it was by an invalid user).

      ***

      It looks like the #changelog formula doesn't work with Components and Fix Version fields. I assumed that that could be a problem with list fields but it works well for Labels. Also, other fields with #changelog work properly.
      Formulas I was trying to use in my notifications, which don't work were:
       

      {{#changelog.fixVersions}} Fix Version has changed from "{{fromString}}" to"{{toString}}"{{/changelog.fixVersions}}

      Result: Fix Version has changed from "" to ""
       

      {{#changelog.component}} Components was removed "{{fromString}}" Component was added "{{toString}}" {{/changelog.component}}

      Result: Components was removed "" Component was added ""

       Also,  fixVersion.name or #changelog.fixVersionsvalue didn't help.

      Workaround: Not available at the moment.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              msood@atlassian.com MonaS
              Votes:
              55 Vote for this issue
              Watchers:
              33 Start watching this issue

              Dates

                Created:
                Updated: