SaiRaviKiran Ak
Tera Guru

Hi,

 

Try Below Code :

var string=[];

var gr=new GlideRecord("incident");
gr.addQuery("problem_id",current.sys_id);
gr.query();

while(gr.next())
{

string.push(gr.number);
}

for (var i=0;i<string.length;i++)
{
current.description=string[i];
current.update();
}

 

Thanks,

Ravi

 thank you for your reply.  i tried the  code which you have posted , its not working 

Can you try below :

 

var string=[];

var gr=new GlideRecord("incident");
gr.addQuery("problem_id",current.sys_id);
gr.query();

while(gr.next())
{
string.push(gr.number.toString());
for (var i=0;i<string.length;i++)

}
current.description=string.join(',');
current.update();

View solution in original post

thank you  for reply

hvrdhn88
Giga Patron

if you are using business rule then you should not use current.update().

on which table are you running this business rule? problem or incident?  if you are running on problem table then 

gr.addQuery('problem_id',current.sys_id);

if on incident table 

gr.addQuery('problem_id',current.problem_id);

i assume you are running on problem table .just try.

 

var check=[];
var gr = new GlideRecord('incident');
gr.addQuery('problem_id',current.sys_id);
gr.query();
while(gr.next())
{
check.push(gr.number);
}
current.description=check;