I'm using the FMC-Workitem-Save-Extension which is really nice! I've created some jobs and they are running fine.
I have a pre-save-script that is calculating a custom currency field depending on the values from backlinked work items. It works fine but only if the respective work item is changed and therefore saved - just as it supposed to be.
Now I would like to to do the calculation also scheduled. So I've created a job in the scheduled job configuration, a new js-script and started to migrate my script so it would work not only for one work item like in the pre-save-script but also for all work items that matches a query.
It seams that everything is running fine BUT now I'm struggling to save the items.
Example:
The
Code: Select all
[...]
// Pass results from BigDecimal to Currency variables
var newCostEstimation = new Currency(costEstimation);
// Setting the value in Work Item
workItem.setCustomField("costEstimation", newCostEstimation);
[...]
is running fine with FMC but doesn't do anything in the new script
Code: Select all
[...]
// Pass results from BigDecimal to Currency variables
var newCostEstimation = new Currency(costEstimation);
// Setting the value in Work Item
electronicModule.setCustomField("costEstimation", newCostEstimation);
[...]
There is no error warning, the script just finishes with
but the work items are not changed.INFO root - Script returned nothing
The used items
Code: Select all
workItem
Code: Select all
electronicModule
, so what am I missing?class com.polarion.alm.tracker.internal.model.WorkItem
Has anyone some hints for me?
Thank you!
Przemek