Skip to end of banner
Go to start of banner

Example 1 - Choose your assignee

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

« Previous Version 11 Next »

Let's say you want to implement a workflow which should let the user choose whose he wants, but to also consider their location and their capabilities. Supposing that each user has a user property with the country that he or she is from and that all of them are grouped by their role in the team, this can be implemented very easily. After the client selects the user they wants help from, an issue can be assigned to this user.

To do this, add a Blitz Actions custom field and configure a button with the following steps:





In this case, all the screens should be visible, so all the condition scripts should return "ENABLED".


The button is the primary screen from where you can select the country.

The screen script for the first button enables you to select available countries. 

BA_setActionTitle("Country");

string[] countries = {"USA", "Canada", "The Netherlands"};
BA_createSelectList("Country", countries, "", false, true, "Select the country where you need help");

BA_setExecuteButtonText("Next");

In the action script of the button, we need to get the value from the screen and save it into an auxiliary value:

string country = BA_getSingleValue(argv, "Country");
BA_setBlitzAttribute("country", country);

After a user selects a country, they should be selecting a further filtering parameter – the office.

The same things should be done for the first step as well. In this case, the screen script should look like this:

BA_setActionTitle("Office");

string[] offices = {"HR", "Sales", "IT"};
BA_createSelectList("Office", offices , "" ,false, true, "Select the office where you need help");

BA_setExecuteButtonText("Next");

In the action script of the first step, we need to get the value from the screen and save it into an auxiliary value:

string office = BA_getSingleValue(argv, "Office");
BA_setBlitzAttribute("office", office);

The last screen provides a list of users that are in the selected country and work in the selected department. That's why the select script should consider the  values set in the previous screens:

BA_setActionTitle("User");

string country = BA_getBlitzAttribute("country");
string office = BA_getBlitzAttribute("office");

string[] users;
string[] usersInOffice = usersInGroups(office);

for (string user in usersInOffice) {
    if (getUserProperty(user, "country") == country) {
        users = addElement(users, user);
    }
}

BA_createSelectList("User", users, "", false, true, "Select the person you want to help you");

In the action script, we only set the selected value as the assignee:

string user = BA_getSingleValue(argv, "User");
assignee = user;

You can go to the issue screen to test the implementation. For this example, after you click the main button, you'll get a succession of the following screens:

After the last screen executes, the assignee of the current issue will be set to the value selected from the field - "josh" in this case.

See also

Example 2 - Logging work as another user

  • No labels