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 5 Next »


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

All you need to do is add a Blitz Actions custom field and configured with a single button and two 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 one can select the country;

    The screen script for the first button should set the select list with the countries available. 

    BA_setActionTitle("Country");
    
    string[] countries = {"USA", "Romania", "Ukraine"};
    BA_createSelectList("Country", countries, "", false, true, "Select the country in which 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);
  • the first step is the one from where one can select the office from where he needs help;
    The same things should be done for the first step as well, since we only select the office here.
    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 in which 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 already set values from 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 assingee:

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


If we go to the issue screen, to test the implementation, after pressing the main button, we'll get a succession of screens as follows:


After executing the last screen, the assignee of the current issue will be set to the value selected from the field.

  • No labels