Versions Compared

Key

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

...

Considering we have a custom field named Department with the following values:

  1. 'Production'
  2. 'Sales'
  3. 'HR'

And ... and we would like to assign an issue to the Department manager at a certain stage.

...

Writing the code

2. Write the SIL code (postfunction) to assign the manager and add it to an appropriate step:

Code Block
titleAssignManager.sil
string sqlSelect;
string[] sqlResult;
string user;

sqlSelect = "select manager from dept_managers where department = '" + Department + "'";
sqlResult = sql("myDB", sqlSelect);

user = getElement(sqlResult, 0);

if(isNotNull(user))
  assignee= user;

...

So, in our example, if the Department custom field is set for example to 'HR', the assignee will be set to the user with the username 'marie'.