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

How can we write script based validators and condition scripting in RTC to display warning message for certain attributes when user wont input the value?

HI All,

In RTC, Attribute customization section Can we write script based validators for  displaying warning message when user leaves the attributes without filling value in workitem?

Can  anyone share the syntax for throwing  warning message for validators or if it is possible in condition script based value?




0 votes



One answer

Permanent link
You are mixing several concepts. I would really suggest to read some of the referenced articles
Making attributes required/mandatory is supported in different ways

1. For work item type and state
2. For conditions - only for this you need JavaScript or Java extensions

There is no way to specify an "Error Message" the UI will show a marker at the attribute and saving will fail if there is no value in a required attribute.

Validations can be specified as well. The "Error Message" is basically specified in the configuration of the validation and not in the script - the script basically only returns an error or a warning or OK.

Read:
For a more detailed how to with examples: https://jazz.net/library/article/1093

0 votes

Comments

Thanks Ralph,

I am aware of making attributes required / mandatory which simple using
1)1. For work item type and state

But our use case is similar but we are following the way as MAster- Child Process Configurations.

We have Master Project Area
Where there are two child Project area using the Master PA process configuration,
But we want to make the few attributes  mandatory only in one of the Child1 PA  not to other child2 PA  ,

Hence in this case we thought to go with script based validations or can it be achieved with conditions

Where we can give the write the script with condition
If(child PA=child1)

We wanted to display warning message and allow workitem to be saved.As you mention the script can written warning  than my above use case can be achieved ?so is there any syntax related to RTC that we have to use?






 JavaScript has only access to work item attribute information. You would have to determine the project area based on one of the attributes of the work item and code it into the script. Not a nice solution. I am not sure if I would take that route. You could try to use required attributes preconditions in the child project area. A much cleaner solution, I  think.


Anyway, 
https://jazz.net/library/article/1003#attributecustomization points to the Wiki and the other link I also already sent has examples. Consider reading  them. They both point to the Wiki with some more JavaScript syntax. 

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
× 6,121

Question asked: Oct 16 '17, 4:59 a.m.

Question was seen: 3,331 times

Last updated: Oct 16 '17, 5:54 a.m.

Confirmation Cancel Confirm