- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 10:30 PM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2018 03:04 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 10:51 PM
Try this:
var tasktable = new GlideRecord ('problem_task');
tasktable.addQuery('problem','current.sys_id');
tasktable.initialize();
tasktable.short_description = 'round1';
tasktable.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 10:59 PM
If you are inserting problem task for a single problem record then try below code:
var tasktable = new GlideRecord ('problem_task');
tasktable.initialize();
tasktable.short_description = 'round1';
tasktable.problem = "give problem record sys_id here"
tasktable.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 11:21 PM
I have tried this method on Scripts Background. For a single record I can be able to add. but while running ATF, it will generate new record right, that is the reason it is not able to fetch current data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2018 11:18 PM
I tried this, but it is not working.
It will be in such a way that,
var (object)tasktable.(field name)problem = current.sys_id of current opened problem.
then it may work.
or do i need to call it from script includes?