Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel

On this page

Table of Contents
maxLevel2
exclude(On this page|Use case).*
stylecircle
typeflat
separatorpipe



UI Text Box
sizemedium
typeinfo

Use case

Create a hierarchy of issues by prioritizing them via a Number Field and a couple of post functions in the Create transition and a global reflexive transition that will update the hierarchy after a new value has been modified or introduced.


Prerequisites

UI Steps


UI Step
Create a custom Number Field called Customer Prioritization and add it to the Create/View/Edit screens,


UI Step

Create a new global reflexive transition (from any issues to itself) and add it a custom screen that includes the Customer Prioritization field.






Configuration


UI Steps



UI Step

Add an Update or copy field values post function to the Create transition in the second position.

UI Steps


UI Step

Target issue*

Select Set target issues manually (parser expression) and add the following expression:

Code Block
languagebash
linenumberstrue
issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {issue.cfCusPrio} + " order by \"Customer Prioritization\" ASC")


UI Text Box
typeinfo

This expression will select all of the existing issues whose Customer Prioritization field value is greater than or equal to the existing one excluding the one from the current issue.



UI Step

Field*

Select the Customer Prioritization field and add the following expression.

Code Block
languagebash
linenumberstrue
{nnnnn} + indexOf(^%{00015}, issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {issue.cfCusPrio} + " order by \"Customer Prioritization\" ASC"))


UI Text Box
typeinfo
This expression will add to the number introduced in the screen for Customer Prioritization the index of the issues in the issue list obtained before in every of the issues according to the issue list in the Target issue field.



UI Step

Conditional execution


Code Block
languagebash
linenumberstrue
%{nnnnn} !=  null


UI Text Box
typeinfo
The post function will only be executed if the field has a value.







UI Step

Add an Update or copy field values post function to global reflexive transition previously created.

UI Steps


UI Step

Target issue*

Select Set target issues manually (parser expression) and add the following expression:

Code Block
languagebash
linenumberstrue
(previousValue({issue.cfCusPrio}) = null ? issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {nnnnn} + " order by \"Customer Prioritization\" ASC") : ({issue.cfCusPrio} < previousValue({issue.cfCusPrio}) ? issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {issue.cfCusPrio} + " and \"Customer Prioritization\" <= " + previousValue({issue.cfCusPrio}) + " order by \"Customer Prioritization\" ASC") : issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + previousValue({issue.cfCusPrio}) + " and \"Customer Prioritization\" <= " + {issue.cfCusPrio} + " order by \"Customer Prioritization\" DESC")))


UI Text Box
typeinfo

This expression will cover three possible situations:

Case 1 - There was no previous value in the custom field Customer Prioritization: The expression will fetch the issues as in the create transition.
Case 2 - The value entered in the custom field Customer Prioritization is smaller than the previous value: The expression will fetch all issues whose Customer Prioritization value is greater than or equal to the entered value and smaller than or equal to the previous value in an ascending order.
Case 3 - The entered value is greater than the previous value: The expression will fetch all issues whose Customer Prioritization value is greater than or equal to the previous value and less than or equal to the entered value in a descending order.



UI Step

Field*

Select the Customer Prioritization field and add the following expression.

Code Block
languagebash
linenumberstrue
(previousValue({issue.cfCusPrio}) = null ? {issue.cfCusPrio} + indexOf(^%{00015}, issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {issue.cfCusPrio} + " order by \"Customer Prioritization\"")) : ({issue.cfCusPrio} < previousValue({issue.cfCusPrio}) ? ^{issue.cfCusPrio} + 1 : ^{issue.cfCusPrio} - 1))


UI Text Box
typeinfo

Depending on the previous cases, a number will be added or deducted from the Customer Prioritization value of each issue of the issue list.









Related use cases

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Parser functions, Label
sortByTitle
cqllabel in ("use-case-workflow","parser_func_indexof","parser_func_previousvalue") and ancestor = "27067093"


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue


Page properties
hiddentrue


JWT feature

Workflow function

Update or copy field values

Parser functionsindexOf() previousValue() issuesFromJQL()
Label



Page properties
hiddentrue



Status
Tech review

Status
titletodo

Style guide

Status
colourGreen
titletododone

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged


...