Problems with order of Scrips, Transactions and etc

Hello.

Attached file is ScripAction that tries automap Priority field to any
CustomField.

Direct mapping is ok(changes of CF -> changes of Priority), but revers
mapping is in troubles.

For example:
We use ‘Basics’ to change Priority, but there is also CF edit forms.
ScripAction do job for SetPriority transaction and change CF(Severity),
in the next few steps RT continue to parse user form data and there is
old CF value that was changed(bt scrip action), then RT update it to old
value.

Please suggest me workaround for this problem.
I have got ideas, but they leads to RT core changes.
Best regards. Ruslan.

PriorityAutoMap.pm (2.93 KB)