It's all about the answers!

Ask a question

How to create a script based on resolved state?

Bruno Cabral (718) | asked Oct 11 '18, 6:56 p.m.

I am trying to create an attribute condition based "Resolved" set state.

Could please somebody help me?

* I don't want to use "required attributes for Type and State", because, I'll need to have two conditions on same script (sev1 and resolved status). For Sev1, script is working fine, but for resolved status, nothing is happening.

current script (not working):

var WorkItemAttributes =;
dojo.declare("ibm.cio.required.sev1H", null, 
matches:  function(workItem, configuration)
var state = workItem.getValue(WorkItemAttributes.STATE);
return (state === "11");
// status = resolved


element details:

<option value="">Resolved</option>


Don Yang commented Oct 12 '18, 12:51 a.m.
did you try with state === ""
( I did not try to run the script on my environment hence a quick check in comment)

Bruno Cabral commented Oct 12 '18, 7:07 a.m. | edited Oct 12 '18, 8:05 a.m.

Hi Don,

An update: Your State is working!!

It seems there was some issue on my server, and the updates made and saved on client were not being reflected as fast as normally is on UI/browser.

Thank you very much!

ps: I am not being able to mark your answer as the correct one, could you please convert your comment to answer (if possible) ? Or even let me know how can I mark your comment as the correct one.

->>Please ignore my previous comment below

Unfortunately, your state is not working either =(
I am still trying with other possible combinations, but with no success, so far.

If you have other suggestion, please let me know.

Ralph Schoon commented Oct 12 '18, 7:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER explains states. If in doubt, debug or log the value of the attribute. 

Note, the state of the work item is the current state, you also get the workflow action in the condition. If the workflow action is not empty, the state of the item after the save will be the target state of the action.

Ralph Schoon commented Oct 12 '18, 7:17 a.m.

Bruno Cabral commented Oct 12 '18, 7:56 a.m.

Hi Ralph, thanks for your updates, two links you sent are very helpful!

I'll share my script as soon as I finish it in order to help others.


2 answers

permanent link
Ralph Schoon (63.2k33646) | answered Oct 12 '18, 2:32 a.m.
edited Oct 12 '18, 2:33 a.m.

 "Resolved" is a state group. I don't think state groups are available in the JavaScript attribute customization API. You have to code in all the states you consider resolved.

permanent link
Bruno Cabral (718) | answered Oct 12 '18, 8:20 a.m.

When associating Don's comment ( with my already saved script, the attribute condition is working fine. Please check below the current code:

Condition: Ticket must be a Sev1 and State moving from any one to Resolved.


(function() {
var WorkItemAttributes=;
dojo.declare("org.example.workitems.providers.FinishedCondition", null, {

      matches: function(workItem, configuration) {
          var state= workItem.getValue(WorkItemAttributes.STATE);
var sev =  workItem.getValue(WorkItemAttributes.SEVERITY);
          return((sev === "severity.literal.l5") && (state === ""));
// sev1
// resolved


Thanks and best regards!

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.