Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi,
I haven't been able to find an example, or figure out the actual data format, on my own... So I'm hoping that someone can point me in the right direction.
The task is simple... We have a multi-select IBPL field. From a trigger-script we need to populate this IBPL field with all possible values. Currently, we're executing a query to get all the values, but I don't have the right data-format to make it work.
Below is an excerpt from our script files that is not working for us. Logically, it is what needs to happen. I'm not able to get the data in the right format and/or using the proper data-types.
Any help on this is greatly appreciated.
-Sean
Code snippet:
var controlsProductIDs = query("(field[Type] =\"Controls Product\")");
var controlsProductHashSet = new java.util.HashSet;
for (var i = 0; i < controlsProductIDs.length; i++)
{
var controlsProductBean = sb.getIssueBean(controlsProductIDs[i]);
var controlsProductName = controlsProductBean.getFieldDisplayString("Controls Product Name");
if (controlsProductName == "Reference" || controlsProductName == "Integrity")
{
// do nothing - skip them for now
}
else
{
controlsProductHashSet.add(controlsProductName);
}
}
var releaseIDs = query("(field[Type] = Release)");
for (var i = 0; i < releaseIDs.length; i++)
{
var releaseBean = sb.getIssueDeltaBean(releaseIDs[i]);
var releaseName = releaseBean.getFieldDisplayString("Release Name");
if (releaseName == "Reference" || releaseName == "Integrity")
{
// do nothing - skip them for now
}
else
{
// Sean !!! - This is not working.. Need to get the actual data-format for doing this operation.
releaseBean.setFieldValue("Controls Products for Release", controlsProductHashSet);
}
}
Solved! Go to Solution.
Figured it out... Use "setPickFieldValue" instead of "setFieldValue"..
Figured it out... Use "setPickFieldValue" instead of "setFieldValue"..