Closing PTASKS from a freeform board
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 10:10 AM
I am a member of a number of freeform Visual Task Boards in our ServiceNow instance and have a number of PTASKS assigned to me from these boards. Is there a way to close the PTASK from the visual task board without having to go in and mark the PTASKS complete? Right now, every user has to go in and mark the task as closed from their TASK view and then go in and archive the card from the board. We would like to just be able to complete the task from the board and get rid of the extra step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 10:20 AM
Jeromy,
To do this you'll have to customize the board to allow State to be a lane field (this can be done by hitting 'i' (info) on the board and then changing the "Lane Field" to "State"). This will change the board for all users of that board. However, you'll now have tasks in lanes related to state, and moving a card to a new state will update the underlying Task record.
-Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 10:51 AM
Check out the ideas in this thread, it mentions 3 different approaches: Does Visual Task Board interact with task.state?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 01:14 PM
Hi Jeromy,
Your stated requirements were to automatically close the Ptasks on Freeform boards from the task board. I am making the assumption you just want to change the state of the Private Task (vtb_task) to Closed Complete when the associated card is moved into the Done lane.
You can do this by putting a business rule on the vtb_card table, to post the state field value back to the Private Task when this lane change occurs on a Freeform board.
Business rule: Change state on ptask Done lane change
Advanced is true
Order is 5000
When is Before Insert/Update
Filter is Lane.Name is Done AND Task.Task Type is Private Task AND Board.Lane field is empty
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var ptaskGR = new GlideRecord('vtb_task');
ptaskGR.get(current.task.toString());
ptaskGR.setValue('state','3');
ptaskGR.update();
})(current, previous);
Note that Private Tasks use the default Task states, so the value of '3' corresponds to Closed Complete. Also, Task Active State Management will respond to the state change and set active to false.
Ed Wajs
ServiceNow Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2017 03:54 PM
Jeromy,
We are glad you were able to take advantage of the ServiceNow Community to learn more and to get your questions answered. The Customer Experience Team is working hard to ensure that the Community experience is most optimal for our customers.
If you feel that your question was answered, we would greatly appreciate if you could mark the appropriate thread as "Correct Answer". This allows other customers to learn from your thread and improves the ServiceNow Community experience.
If you are viewing this from the Community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Thanks!