Comma separated value of system properties is not working.

rajesh29
Tera Expert

Hi,

I have added the approver email id in system property value. I have configured the approvers by using system properties in some catalog items. if value is having one approver it working properly. 

when I add more than one email id's with Comma seperated it's not working. how to get two approvers by adding value in system property? 

script Include:

if(r == 'test_BSBS')
a.push(this.getApproverSysID('hbw.approvers.bs.test_bsbs'));

return a;
},

 

Thanks,

Rajesh Bandila

7 REPLIES 7

Filipe Cruz
Kilo Sage
Kilo Sage

Hello rajesh,

Can you paste here the code of the method that is consuming your system property?
It all depends on the way you are processing the system property.

I'll be waiting for your feedback!

Best Regards,

Filipe Cruz

@Filipe Cruz Thank you,

var approverUtil = Class.create();
approverUtil.prototype = {
initialize: function() {
},

gs_hardware: function(obj) {
if (obj.org != "GS")
return;
gs.info("JSON "+ new JSON().encode(obj));
var r = obj.gsnow;
var a = [];

if(r == 'backup')
a.push(this.getApproverSysID('hdw.approvers.gs.backup'));

if(r == 'UPS')
a.push(this.getApproverSysID('hdw.approvers.gs.UPS'));


return a;
},

Hello rajesh,

Is the method getApproverSysID the one having the property has input parameter?
If so, can you show the code of that method?

Thanks!

Best Regards,

Filipe Cruz

Hi Rajesh

Try converting an array to a comma delimited string at the end.

Instead of

return a;

Try

return a.join(',');