Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Required Attributes For Condition is not working properly

Hello All,


In my demo project i have added new attribute named as 'RootCauseAnalysis'. My task is to make this field as mandatory when user selects severity as Critical. so to do this i have set "Require attributes for condition" precondition for this newly added attribute.

I can see Asterisk sign on "RootCauseAnalysis" field but, even if i keep this field empty, application accepts empty string and saves the work item. I think it should show "Attribute 'RootCauseAnalisis' is not set" error.

I have used below script for same: (CLM 6.0.3)

dojo.provide("com.example.Condition");

(function() {
    dojo.declare("com.example.Condition", null, {

        matches: function(workItem, configuration) {
           
        var workitem = com.ibm.team.workitem.api.common.WorkItemAttributes; 
        var severity = workItem.getValue(workitem.SEVERITY); 
        if(severity == "severity.literal.l5")
        {
           return true; 
        }
        else 
        {
           return false;
        }
        }
    });
})();

Please let me know what i am missing while setting precondition.I referred below link:

0 votes


Accepted answer

Permanent link

I have tried 'Required Attributes For Condition' recently with 6.0.2 and 6.0.4 and both works fine.
I notice that your script does not have
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(under dojo.provide("com.example.Condition");)
I did not test the script without the above line so I don't know the impact of lacking it.

"I can see Asterisk sign on "RootCauseAnalysis" field ": do you see Asterisk sign on both web and Eclipse client?
or it is only in Web client but Eclipse shows no ' Asterisk sign'?

In general, there are two things I would suggest to check with:

1) https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Configuring_a_script_based_custo
check 'Enable Process Attachment Scripts property ' is set to true

2) In Eclipse client, open the project and go to Link tab > Attachment, check if you see any 0 byte .js file.
If yes, delete it and try to test again.

Snehal Yendhe selected this answer as the correct answer

1 vote

Comments

 Hi Don,


 Thanks for this information. I have added the 

[dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); ] in my code and now its working properly. 


One other answer

Permanent link

In addition to Don's comment, I see over and over again that it is not clear how operational behavior works and it is frequently configured wrong and not called when the user expects it to be.

Carefully read

  and Process permissions lookup in Rational Team Concert 2.0 and be aware of the differences of permission and operational behavior.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 1,221

Question asked: Feb 13 '18, 2:41 p.m.

Question was seen: 2,798 times

Last updated: Feb 14 '18, 6:50 a.m.

Confirmation Cancel Confirm