Use Enumeration Custom Field for Workflow Condition

Description
daicher_for
Posts: 1
Joined: Tue May 22, 2018 2:24 pm

Use Enumeration Custom Field for Workflow Condition

Postby daicher_for » Tue May 22, 2018 2:29 pm

Hello,

I want to use the value of a custom field (Typ:enumeration) as a condtion for a workflow action.

That's my script:

Code: Select all

var transitionPermitted = false;
var workItem = workflowContext.getWorkItem();
if(workItem.getvalue("feasible")=="yes") transitionPermitted = true;
transitionPermitted;


The condition works, when I use "String" as Field-Type. As soon as i choose "Enum" it doesn't work.

Could anyone help me with that issue?

Thank you very much in advance!!

Kind regards,
Dirk

SaoBit
Posts: 7
Joined: Tue May 12, 2015 8:02 am

Re: Use Enumeration Custom Field for Workflow Condition

Postby SaoBit » Thu May 24, 2018 3:57 pm

Hello,

getValue returns an object, in this case an IEnumOption. To compare it to "yes" you will have to compare the id of the object:

Code: Select all

if(workItem.getvalue("feasible").id == "yes") transitionPermitted = true;


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 7 guests