How to Create Problem task record on problem table with script

IbrahimVali
Tera Guru

How to Create Problem task record on problem table by using script in ATF.

I have used this method, It is creating a record in problem task table but, not able to relate with particular problem in ATF.

var tasktable = new GlideRecord ('problem_task');
tasktable.initialize();
tasktable.short_description = 'round1';
tasktable.problem = ('sys_id', current.sys_id);
tasktable.insert();

there is a field 'problem' in the problem task record write, in that I need to be get that related problem number.

Thanks.

1 ACCEPTED SOLUTION

IbrahimVali
Tera Guru

Found a correct answer:

Flow A:   1. Open, 2. Set field Values, 3. Submit (Problem record on 'problem' table);

Flow B:   1. Open, 2. Set filed Values (problem field= give the reference of problem record which is                                     submitted previously), Submit (Problem Task record on 'problem_task' table)

 Flow C:   Run test, you will get related problem number on problem task record.

 

Thanks.

View solution in original post

8 REPLIES 8

If the current  object is referring to the required problem record then use this:

 

var tasktable = new GlideRecord ('problem_task');
tasktable.initialize();
tasktable.short_description = 'round1';

tasktable.problem = current.sys_id;
tasktable.insert();

This is also not working.

Thanks.

IbrahimVali
Tera Guru

Found a correct answer:

Flow A:   1. Open, 2. Set field Values, 3. Submit (Problem record on 'problem' table);

Flow B:   1. Open, 2. Set filed Values (problem field= give the reference of problem record which is                                     submitted previously), Submit (Problem Task record on 'problem_task' table)

 Flow C:   Run test, you will get related problem number on problem task record.

 

Thanks.

blanca12
Mega Contributor

 

Try this:

var tasktable = new GlideRecord ('problem_task');

Lucky Patcher 9Apps VidMate