RTC: What do you think is the best way to force (and keep) Owned By = Unassigned while in a particular state?
I am hoping that I might get some good direction on how best to handle this scenario:
3 answers
How about a validator? It can be a bit annoying when a user finds this out only after clicking the Save button, but it should meet you "force and keep" requirement.
Comments
Hi Donald,
You do have the option to customize the error message. See the sample code here:
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Script_Based_Validation
Thanks for the reminder Donald!
I am not sure if a read only by condition would work. The safest would be a work item save advisor. I agree to Donalds statement though.
Comments
Thanks Ralph.
I would argue what the business value of this customization is - I don't see any. I was actually about to add that to my answer, but then decided to save the time.
I totally agree Ralph. That is another reason I don't really want to spend cycles on this.
I'm not sure I'm correctly visualizing what Ralph and Donald are suggesting. It sounds like they are saying there should be a pre-condition that will prevent you from moving the work item into the "Inventory" bucket unless the Owned By is set to Unassigned. Then once in that state, the attribute could be made read-only or another pre-condition could disallow modification of the attribute while in that state.
That would work, but it forces the user to set the "Owned By" before they can move it into the Inventory bucket. If that's considered more cumbersome than desired, there could be an alternative.
You could handle this with a follow-up action instead of a pre-condition. The Follow-Up would set "Owned By" to Unassigned if the work item was in the Inventory bucket. It would do it when the work item was first moved into that bucket and reset the value back to "Unassigned" if it was changed. You'd probably want to display some kind of warning when it does it though so the user doesn't get confused as to why they cannot set the value.
Comments
No, I said, you can try to use a condition and the operational behavior read only by condition to make the contributor attribute read only if owner is unassinged. I am not sure that will work.
The safest way is a custom work item save advisor that prevents the owner/contributor from being set, or the state to be changed if the owner/contributor is anything other than unassigned.
Thanks for the response Nate.
My personal experience and the experience with forum questions in that area with JavaScript Attribute customization is pretty bad. Various reasons, find some of the limitations here: https://rsjazz.wordpress.com/2016/07/15/rtc-process-customization-what-you-can-and-cannot-do/ and in many of my answers and the API description.
If I could I would rip the JavaScript attribute customization out of the tool. It is far too limited but too easy to access so it seems to also attract users that probably don't have programming and development skills. This causes all kinds of issues (e.g. impact performance). Business Process customization should be limited to stuff that is worth the effort. Obviously I am not very successful in advertising that aspect.
Just because I publish a lot of API example does not mean I want to promote to implement stuff just because one can. It has to pay back the development which means if only the Java Server API was available users would really start thinking if they need certain stuff or not (you mentioned a free resource which s now gone - I'd say no resource is free).
Thanks for that insight Ralph. Since I am usually contractually bound with very budget conscious customers (aka cheap) I try to look at the expedient way to accomplish most of the requests that come in. That usually forces me to spend time with the JavaScript attribute customization although there have been times where we needed to develop a robust solution using the API.