SetAttribute in Groovy script after calling a REST Api not changing status?
Hello,
We have a script of calling third party web service and after that script we want to update the status of the Service Request, but it's not working with setAttribute function. So here is my code:
def POST_param =
[
Title : Title,
Proizvod : "product ACC",
Details : ProblemDescription,
CreatedBy : SrCreatedBy,
Priority : SeverityCd,
NazivKlijenta : ReportedByPartyName,
BrojTelefona : PrimaryContactFormattedPhoneNumber,
EmailAdresa : PrimaryContactEmailAddress,
KanalPrijema : ChannelTypeCd,
Kategorija : NadleznaSluzba_c,
Posiljatelj : SrCreatedBy,
TicketStatusName : StatusTypeCd,
IncidentId : SrNumber,
AdresaKlijenta : PrimaryContactFormattedAddress
]
adf.webServices.ticketing_sistem_5.POST(POST_param)
def vo = newView('ServiceRequestVO')
def foundRows = vo.findByKey(key(SrNumber),1)
def found = foundRows.size() == 1 ? foundRows[0] : null;
if (found != null) {
setAttribute('StatusTypeCd','SVC_SENT')