How to create a script based on resolved state?
Hello,
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):
dojo.provide("ibm.cio.required.sev1H");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function()
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function()
{
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("ibm.cio.required.sev1H", null,
{
matches: function(workItem, configuration)
{
var state = workItem.getValue(WorkItemAttributes.STATE);
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("ibm.cio.required.sev1H", null,
{
matches: function(workItem, configuration)
{
var state = workItem.getValue(WorkItemAttributes.STATE);
return (state === "11");
// status = resolved
}
});
})();
// status = resolved
}
});
})();
--------------------
element details:
<option value="com.ibm.team.workitem.defectWorkflow.state.s11">Resolved</option>
Thanks!
2 answers
Hello,
When associating Don's comment (https://jazz.net/forum/users/dyang) 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.
When associating Don's comment (https://jazz.net/forum/users/dyang) 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.
------------------------------------------------------------------------------------------------
dojo.provide("org.example.workitems.providers.FinishedCondition");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.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);
console.log(typeof(state))
return((sev === "severity.literal.l5") && (state === "com.ibm.team.workitem.defectWorkflow.state.s11"));
// sev1
// resolved
}
});
})();
------------------------------------------------------------------------------------------------
Thanks and best regards!
Comments
Don Yang
Oct 12 '18, 12:51 a.m.Bruno Cabral
Oct 12 '18, 8:05 a.m.Hi Don,
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!
Unfortunately, your state is not working either =(
I am still trying with other possible combinations, but with no success, so far.
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Oct 12 '18, 7:16 a.m.https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_an_item_s_Status_attri explains states. If in doubt, debug or log the value of the attribute.
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Oct 12 '18, 7:17 a.m.Process Enactment Workshop for the Rational solution for Collaborative Lifecycle Management has some hints in the last lab.
Bruno Cabral
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.
Thanks!