Versions Compared

Key

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

Let's say you want to implement a workflow which should let the user to choose from whom whose he wants help, but to also consider their location and their capabilities. Supposing that each user has an a user property with the country that he 's 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 chooses selects the user he they wants help from, we can assign the issue to him.All you need to do is an issue can be assigned to this user.

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

...

Image Added





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

Code Block
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:

Code Block
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:

Code Block
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:

Code Block
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:

Code Block
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:

Code Block
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 executing 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