It's all about the answers!

Ask a question

RTC: Read-Only Attributes For Condition not working in the Plan view


Miguel Tomico (5001423) | asked Oct 08 '15, 12:32 p.m.
edited Oct 08 '15, 12:38 p.m.
RTC 5.0.2.
A "Read-Only Attributes For Condition" precondition is working beautifully in the work item editor presentation, but it is not working in the Plan view. The attribute is editable there. It can be modified and saved.

I am wondering if this is a defect or it's the expected behaviour.

Other type of preconditions do work in the Plan view.
Is it possible that this one is not working because it relies on a javascript, which is only run in the editor presentation, but not in the plan view?
Thank you.

Accepted answer


permanent link
Miguel Tomico (5001423) | answered Apr 06 '16, 4:34 a.m.
I forgot to update this question. Apologies for that.

This issue seems to be due to a wider limitation.
Plan views don't include all javascript libraries, as compared to Work Item Editor presentations.
According to a jazz developer:
"The 'Read Only Attributes For Condition' operation behavior is not considered by the current plan editor design."

More info here:
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=373507

Ralph Schoon selected this answer as the correct answer

Comments
1
Ralph Schoon commented Apr 06 '16, 5:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Thanks Miguel. Please be aware that in the work item Web UI, there are a lot more JavaScript libraries available. But conditions are also supposed to run in the Eclipse client, where these are not available either. So the assumption to have all the JavaScript libraries available and actually also have valid values in objects is likely not true.

One prominent example is the loggedin user, which you can get in the Work Item Web UI, but you can't get if the script runs in the Eclipse UI.

One other answer



permanent link
Alexandre Stegani (8664) | answered Oct 08 '15, 4:10 p.m.
 Hi Miguel,

I did a quick test using a sample script from this article and it worked fine for me on both work item view and plan view.


My environment has 5.0.2 with iFix006. Can you give it a try using this test script as well?

Comments
Miguel Tomico commented Oct 09 '15, 7:33 a.m. | edited Apr 09 '16, 12:54 p.m.

Thanks a lot for your support, Alexandre.


You are right, the sample script from the article works fine in Plan view as well.
I've narrowed down the problem, and it seems to be in my script:
com.ibm.team.repository.web.client.session.Session seems to be somehow available in the Editor Presentation, but not in the Plan View.

dojo.provide("com.DO.IsLoggedIn");

(function() {
    dojo.declare("com.DO.IsLoggedIn", null, {
        matches: function(workItem, configuration) {
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); 
dojo.require("com.ibm.team.repository.web.client.session.Session");
  var workItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
    var getAuthenticatedContributor = com.ibm.team.repository.web.client.session.getAuthenticatedContributor;
        var loggedInUser = getAuthenticatedContributor().itemId;
        var owner = workItem.getValue("owner");
            var result = (loggedInUser != owner);
            return result;
        }
    });
})();

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.