You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

On this page

Use case

Prerequisites

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

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




Configuration


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

Target issue*

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

issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {nnnnn} + " order by \"Customer Prioritization\" ASC")

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.

Field*

Select the Customer Prioritization field and add the following expression.

{nnnnn} + indexOf(^%{00015}, issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {nnnnn} + " order by \"Customer Prioritization\" ASC"))
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.

Conditional execution

%{nnnnn} !=  null
The post function will only be executed if the field has a value.



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

Target issue*

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

(previousValue({nnnnn}) = null ? issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {nnnnn} + " order by \"Customer Prioritization\" ASC") : ({nnnnn} < previousValue({nnnnn}) ? issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {nnnnn} + " and \"Customer Prioritization\" <= " + previousValue({nnnnn}) + " order by \"Customer Prioritization\" ASC") : issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + previousValue({nnnnn}) + " and \"Customer Prioritization\" <= " + {nnnnn} + " order by \"Customer Prioritization\" DESC")))


Field*

Select the Customer Prioritization field and add the following expression.

(previousValue({nnnnn}) = null ? {nnnnn} + indexOf(^%{00015}, issuesFromJQL("issuekey != " + %{00015} + " and \"Customer Prioritization\" >= " + {nnnnn} + " order by \"Customer Prioritization\"")) : ({nnnnn} < previousValue({nnnnn}) ? ^{nnnnn} + 1 : ^{nnnnn} - 1))





Related use cases


If you still have questions, feel free to refer to our support team.