Note
We've packed up and moved from Confluence to Discourse to bring you a better, more interactive space. Out of courtesy we didn't migrate your user account so - you will have to signup again
The Exalate team will be on holiday for the coming days - returning Jan 4
Enjoy & stay safe
Hi there,
I am working on a solution for my client and I need some help.
At my client the following configuration is given:
System A
System B
My task is to configure a sync between these systems by syncing all data from system A to system B including the synchronization of the sensitive data from the subtask existing in system A to the "main" issue existing in system B.
Currently my solution is syncing only the two "main" issues (in system A and in system B), the subtask in system A is excluded from sync.
Using scriptrunner I successfully set up a trigger in system A to start a resync on the parent issue when something changes in the connected subtask in system A.
In the outgoing sync rule I wrote a groovy script to select correct subtask and get sensitive data (field value) stored on it. I stored this value in replica.customKeys (please see code below).
In the incoming rule I am attempting to get the value from replica.customKeys.
My problem is that is seems like I do not get the actal value from the customfield of the subtask, instead I get a previously stored value. Seems like it is cached somehow.
I attached my sync rules, I have cleaned them to only contain the code related to this problem.
Please help me with this problem. Any recommendations are for a solution are welcome.
Many thanks!
Cheers,
Gabor
Hi Gabor,
I see on the outgoing script, you are defining getCFValue after it is used. Shouldn't it be defined before?
Kind regards,
Ariel
Hi Ariel,
I think getCFValue is ok there, it is working.
I attach my actual scripts (I have simplified them as I can) in case you can test it in your environment.
In my test I had the following data in my systems:
My outgoing rule:
My incoming rule:
If I change any field on TETETE-43 issue, my sync rule run and I see the following in my log - "_ha" field value is not ok, the value is outdated:
If I run the following script in script console, I get the correct "_ha" value
Thanks for your help!