Ensure single assignee

Description
sk-tsb
Posts: 16
Joined: Tue Jul 17, 2018 8:23 am

Ensure single assignee

Postby sk-tsb » Wed Sep 19, 2018 11:07 am

Hello all,

how is it possible to ensure that a workitem has got only one single assignee ? I want to restrict the numbers of assignees per workitem to 1 (single assignment ).

Cheers Sven

sk-tsb
Posts: 16
Joined: Tue Jul 17, 2018 8:23 am

Re: Ensure single assignee

Postby sk-tsb » Tue Sep 25, 2018 7:07 am

Hello,

really no idea how to ensure to have only one assignee for a workitem ?

Cheers Sven

sk-tsb
Posts: 16
Joined: Tue Jul 17, 2018 8:23 am

Re: Ensure single assignee

Postby sk-tsb » Tue Sep 25, 2018 9:19 am

Hello,

for example when i add a new custom field from type "Enum" i have the opportunity to activate wether this custom filed is a multi field or not by clicking the "Multi" Checkbox. I search for a similar configuration for the intrinsic "assignee" field.

Cheers Sven

Jürgen
Posts: 43
Joined: Tue Sep 12, 2017 1:02 pm

Re: Ensure single assignee

Postby Jürgen » Thu Sep 27, 2018 1:11 pm

The field assignee is special in Polarion, so you probably have to live with it, and that means, you may have multiple assignees. I don't know of a configuration that prevents multiple assignees, except limiting the people with the role assignee to one.

I can propose workarounds though
a) create your own custom fields for user assignment => only one value possible. But of course, this won't use the role "assignee", but would depend on an enum or be a text field.
b) create a report to be printed every day, that searches for multiple assignees, or that just writes the work item with its assignees into a list, where you can see on one glance, if there is a wrong assignment.

sk-tsb
Posts: 16
Joined: Tue Jul 17, 2018 8:23 am

Re: Ensure single assignee

Postby sk-tsb » Fri Sep 28, 2018 10:18 am

Hello Jürgen, thank you for your description and possible workarounds. I'm staying on this topic and keep you informed if there are any news. Thanks for so far.

PatrickClaus
Posts: 11
Joined: Thu Jan 18, 2018 11:02 am
Location: Frauenauracher Str. 85, 91056 Erlangen

Re: Ensure single assignee

Postby PatrickClaus » Tue Oct 02, 2018 9:23 am

Hello sk-tsb,

I would not really recommend this solution - but if absolutely needed, you can implement a savehook script to check for size of assignee list on every save of the workitem.
Keep in mind that this can be taxing on performance and load times, but if only needed for certain projects and status of the workitem, it can work.

Steps to do:
1. Install and set up the workitem savehook extension: http://extensions.polarion.com/extensio ... -item-save
2. For an example workitem "defect" in which you want to check for assignees, set up a file "defect-pre-save.js", according to the documentation of the extension
3. Input code into "defect-pre-save.js" like this:

Code: Select all

// Load compatibility script - this is not needed, but can help in some cases
load("nashorn:mozilla_compat.js");
// Import the java.awt package - if required!
importPackage(com.polarion.alm.tracker.model);

var projectId = workItem.getProjectId();
var result = "";
switch (projectId) {
   case "your_project_id":
      #include function_single_assignee_check.js
}


4. Add the function to check for single assignee:

Code: Select all

// This script ensures defects are only assigned to a single assignee
//
// To make it work, you only have to copy this script
// to "Polarion\scripts\workitemsave\function_single_assignee_check.js"
// and install the FMC Extension for Polarion
//
var assigneesCount = workItem.getAssignees().size();
if(assigneesCount > 1) {
   result = "You are only allowed to assign a defect to a single assignee.";
}



This could work.
Hope that the answer helps. It is highly recommended to test it out on a suitable Test environment first(!).
Best Regards,
Patrick Claus

External service provider at Valeo Siemens eAutomotive GmbH
Frauenauracher Str. 85
91056 Erlangen, Germany
Mail Address

fbachmann
Posts: 43
Joined: Thu Apr 24, 2014 12:10 pm

Re: Ensure single assignee

Postby fbachmann » Tue Oct 02, 2018 12:45 pm

I would rather go down the road of "packing" this into a transition, allowing assignee changes only for the script (and maybe the SysAdmin). Create a "New Assignee" field (single-value user) and make the script set the value of "assignee" to the value in this field. Then assign this script to a "Reassign" action (with same from/to status) and you should be able to trigger the script.

sk-tsb
Posts: 16
Joined: Tue Jul 17, 2018 8:23 am

Re: Ensure single assignee

Postby sk-tsb » Tue Oct 02, 2018 5:29 pm

Hello PatrickClaus and fbachmann,

thanks for the information and suggestions. I agree that check single assignee with each save-event is too much server-consuming stuff. The savehook therefore is a backup solution....

I also agree with Mr Bachmann to put this issue into a transition. The idea is to have a transition where is is ensured that only one assignee is set (otherwise saveing of new status is not possible ). From this status the assignee field is read only and can not changed it unless the status of the WI is set back to the "old" status where anybody can set (one single ) assignee. Only one transition allows to set the single user. If i need more than one transition to ensure a single user i have to set this transition control to each transition. I got an idea about the script. I keep you informed. Thanks a lot so far.

Cheers Sven


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 3 guests