The Zurich release has arrived! Interested in new features and functionalities? Click here for more

how to create a new Card in an existing Visual task board using script

Yahav Mor
Tera Contributor

Hi,

How can I create a new card using script in an existing visual task board. I tried this script but I had no luck:

YahavMor_0-1717926083414.jpeg

 

1 ACCEPTED SOLUTION

Anyway, your scripting is a bit off. The structure itself, though also some reference fields are missing. For example see this:

 

MarkRoethof_0-1717927672010.png

 

You've only scripted the lane and task reference.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

9 REPLIES 9

Anyway, your scripting is a bit off. The structure itself, though also some reference fields are missing. For example see this:

 

MarkRoethof_0-1717927672010.png

 

You've only scripted the lane and task reference.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

YahavMor_0-1717928281033.jpeg

still don't work

Very quick working example script:

 

var vtb = new GlideRecord('vtb_board');
vtb.addQuery('sys_id, 'f11a605983a202102668b0d6feaad3b1');
vtb.query();

if (vtb.next()) {
	var card = new GlideRecord('vtb_card');
	card.initialize();
	card.board = vtb.getUniqueValue();
	card.lane = '0a1aa05983a202102668b0d6feaad34c';
	card.task = '9db629f783e646102668b0d6feaad3ac';
	card.order = '0';
	card.insert();
}

 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

@Mark Roethof  we tried this and we are not getting any error but the card is still not created