...
A SIL condition which checks if due date is before current datethe day after tomorrow:
Code Block |
---|
|
return dueDate > (currentDate() + "2d"); |
More useful date routines can be found in the Date Routines section.
...
Code Block |
---|
|
string ROLE = "DevelopersAdministrators";
return isUserInRole(currentUser(),project, ROLE); |
Only / Except users in custom field
A SIL condition that allows you to disable a particular transition when the current logged in user is in a multi user picker custom field (eg Team):
Code Block |
---|
|
return elementExists(Team, currentUser()); |
If you want the transition to be available to any user except the ones from the multi user picker cf Team, you have to negate the previous condition:
Code Block |
---|
|
return !elementExists(Team, currentUser()); |
Users in a field are/aren't in a project role
A SIL condition that makes a transition available only if all users in multi user picker custom field Team are in project role Developers:
Code Block |
---|
|
string ROLE = "Developers";
for(string user in Team) {
if(!isUserInRole(user, project, ROLE)) {
return false;
}
} |
If you want to disable the transition if at least one user from multi user picker cf Team is in role Administrators, use the following:
Code Block |
---|
|
string ROLE = "Administrators";
for(string user in Team) {
if(isUserInRole(user, project, ROLE)) {
return false;
}
} |
A custom field is/isn't initialized
A SIL condition that allows you to disable a particular transition if a custom field is not initialized:
Code Block |
---|
|
return isNotNull(customfield_10000); |
If you want to disable the transition if field is initialized you should use:
Code Block |
---|
|
return isNull(customfield_10000); |
Check user property
A SILcondition which checks if a user property has a certain value:
Code Block |
---|
|
string COUNTRY = "Romania";
return getUserProperty(currentUser(), "country") == COUNTRY; |
Condition based on boolean expression
...