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

Compare with Current View Page History

« Previous Version 26 Next »

It is highly recommended to test your expression before publishing the workflow.

5 steps to test your expression

Type in your expression or select one of the built-in examples.

Click on the Run button 

Select an issue you want to test your expression with.

Confirm your selection by clicking on Run

Check the resulting output or analyze the errors.

Syntax check

Before running your expression against a certain issue, it's recommended to check if the syntax is correct.

The syntax check button shows if the current expression in the input field is syntactically correct (tick) or not . The background check runs every second, but you can also push the Syntax button for instant results.

SCREENCAST Jona Ittermann2

OutputDescription

Valid expression: The parser expression entered is valid.

Parsing error: The parser expression entered is not valid and you can do the following to fix the issue:

  • Check your selected Parsing modes
  • Try an example configuration from the right hand side of the configuration interface

Syntax check

Before running your expression against a certain issue, it's recommended to check if the syntax is correct. The syntax check button shows if the current expression in the input field is syntactically correct (insert the green icon) or not(insert the red icon). It's updated every second, but you can also push the button. In the latter case, a pop-up window shows up and displays the result of the syntax check. 
Either the syntax is correct:



Or something is wrong with the structure of the expression. A respective error message is shown. In the example below a closing bracket for the function count is missing:


Running a test with wrong syntax 

Even if you omit the syntax check, you can test your expression using the Run button. In this case, the same error message as for the syntax check is shown.

Running a test which returns an error

Even if the syntax of the expression is correct, it may happen that the expression result is erroneous, e.g. when fields are empty.

In this example the value of the custom number field "cf10041" is returning a value which doesn't suit as a correct parameter for the function substring.



Running tests which return different data types
Please adjust the layout - it's not yet nice or fancy...

Depending on the parsing mode and expression, different types are returned as a result of the expression, e.g.

Composing complex expressions

When composing complex expressions like a logical one where you compare values it's recommended to 

  • create single expressions for the operands of the comparison
  • test them with parsing mode General or Jira expressions (depending on the type of parsing mode you need for the condition)
  • put them together and test the complete expression with parsing mode Logical and Jira expression, respectively

Example with screenshots/screencast (I don't know which is the preferred way here) And if someone has a really good exmple instead of mine: please adjust!!

Goal: creating a comment with a remark if an issue is overdue for more than one week

  1. Find issues which fulfill/don't fulfill the condition and use them as the selected "current issue"
  2. Build a condition
    1. General mode: Difference between issue.dueDate and issue.created by using the number values of the dates ({issue.dueDate} - {issue.created} (=> some milliseconds) Remark: display the text values for control with %{issue.dueDate} and %{issue.created} in a separete line 
    2. General mode: Getting the days: extend the expression:  ({issue.dueDate} - {issue.created})/DAY  Remark: omitting the brackets is a nice error source
    3. Logical mode: Adding the comparsion ({issue.dueDate} - {issue.created})/DAY > WEEK
  3. Use this condition as parameter for the conditional operator (General mode): Issue %{issue.key} %{({issue.dueDate} - {issue.created})/DAY > WEEK ? "is overdue" : "is in time"}

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