Skip to end of banner
Go to start of banner

If-Else

Skip to end of metadata
Go to start of metadata

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

Compare with Current View Page History

Version 1 Next »

This is probably the second most common statement to use. It is helpful when working
with fields that contain multiple values or when working with multiple issues
(just for an example).

Example 1 - Finite number of loops

number monthNumber = month(currentDate());
string monthName = formatDate(currentDate(), "MMMM");

if(monthNumber > 0) {
    runnerLog("Example 1: It is the month of " + monthName + "!");
}

Example 2 - Looping through an array

number monthNumber = month(currentDate());
string monthName = formatDate(currentDate(), "MMMM");

if(monthNumber > 12) {
    runnerLog("Example 2: Time no longer exists :(");
}

Example 3 - Looping through an array with index

number monthNumber = month(currentDate());
string monthName = formatDate(currentDate(), "MMMM");

if(startsWith(monthName, "J") == true) {
   runnerLog("Example 3: This month " + monthName + " starts with the letter 'J'.");
}

  • No labels