As an admin I want to see which workflows use a specific resolution prior to deletion

XMLWordPrintable

    • 1

      Problem

      To properly maintain an instance it may be needed to cleanup unused resolution, specially after merging instances or migrations when you could have duplicate resolution.

      When attempting to delete a resolution you're presented with a screen saying how many issues have that resolution but there's no reference to workflows that could still be referencing it.

      Deleting a resolution that's actively being set on workflows will lead to inconsistencies so it would be useful to be warned about existing references or even have a list of associated workflows.

      Suggested Solution

      A possible solution would be to look up references in workflows and provide a list of it when you attempt to delete the resolution.

      Why This Is Important

      This would prevent breaking active workflows that use the resolution and facilitate cleaning up the instance.

      Workaround

      There's no simple way of "querying" all workflows for a given resolution to see if it can be found on a post-function. When a resolution is set on a workflow through out-of-the-box post-function it should contain this format:

      • 10000 is the ID of the example resolution.
                  <function type="class">
                    <arg name="field.name">resolution</arg>
                    <arg name="field.value">10000</arg>
                    <arg name="class.name">com.atlassian.jira.workflow.function.issue.UpdateIssueFieldFunction</arg>
                  </function>
      
      • All workflows are stored in the jiraworkflows tables.

      This query can get workflows that reference that resolution (tested on PostgreSQL):

      select * from jiraworkflows where descriptor LIKE '%<arg name="field.name">resolution</arg>%\n%<arg name="field.value">10000</arg>%';

              Assignee:
              Unassigned
              Reporter:
              Filipi Lima
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: