- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 03:55 AM
Hi All ,
I have a reference qualifier field called swapped_ci in task_ci table. this table stores data about related records information. now my requirement is if task number contains INC then this field should restrict values based on the model present in affected ci field. Ex. in the selected affected ci if model is personal computer then only the ci which have model personal computer should be available in the reference field. Also , This should be applicable only for incident records but nor for other records . for other records it does not have any condition. So if anyone knows solution to this then please assist.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 02:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 04:36 AM
Put your model condition on the reference qualifier within a dictionary override on the incident table.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 04:46 AM
Hi Mark , Actually dictionary override option was not displaying. The reference field is not extended from any other table. only if the field was extended from any table we see dictionary override option. if the field exists in the same table then dictionary override will not be an option.
To be more in detail. the task_ci stores related list information Ex. in incident form if affected ci was selected then in related list it will display ci name. like this simularly in problem and change also the related list will display based on the affected ci selected. so now particularly to incident table if there is any value in the related list. then swapped ci field should restrict the reference field with some conditions otherwise it should not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 05:05 AM
If it's not extended from task (which was my assumption because you wanted it to work only for incidents, not on other tables), you can just put the reference qualifier on the field itself. It will have no impact on other tables, if the field is on the table itself.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2024 05:16 AM - edited 07-31-2024 05:45 AM
javascript: var toReturn = ""; if(current.task.getDisplayValue().startsWith('INC')) toReturn = 'sys_class_name=' + current.ci_item.sys_class_name; toReturn
It looks wonky but it works. My working example to only show users of a certain department when the task is an INCxxx :
Edit: Rereading your requirements, I forgot it needs to dynamically use the class of the affected CI. I don't think it's possible in this way. What I posted doesn't seem to allow dotwalking, which is what you need to retrieve the class of the affected ci. It does support dotwalking. My previous attempt must have had another error somewhere. I don't know if my code will work exactly for what you want, but it should give you a structure to adjust to your needs.