Skip to main content
Nov 17, 2015 10:03 AM UTC
Question

Blocking relationships Trigger

     Hi,

I'm making a trigger that blocks some relationships establishments between items that belong to different projects. I wrote rules that raise the trigger when they are matched.

When a user establish or edit a relationship and the trigger is raised, the script tests if the source and the destination of that relationship belong to the same project. If not, it displays an error.

I have a problem when I edit 2 different types of relationships at the same time (before clicking on "Apply") and one of them should make the trigger raised and the other should not.

The problem is my script tests all the modified relationship fields (I use getDeltaFieldNames() from the LocalTriggerManager.ScriptIssueDeltaBean class).

Is it possible to get in the scipt only the field that raised the trigger ?

Thanks

    2 replies

    Nov 19, 2015 5:08 PM UTC

    Hello Hassan KOBROSLI,

    I think what you want to do is have the trigger veto execute if there's at least one violating relationship, rather than if there is at least one legal relationship.

    Regards,
    Kael

    Dec 29, 2015 6:09 PM UTC

    Hassan KOBROSLI‌,

    Did modifying your trigger to veto on at least one violating relationship help?

    Regards,
    Kael