How to get the taskId of task being assigned

If we plan to send a customized email notification for users for task assignment, how do we send the link for the task?? point here, is there a way where i can get the taskId of the task being assigned (other than creating the report and getting the task id from there) and send it as a link in the customized email. We have a parallel task for emai lnotification and UI task.

OriginalPostID-220931

OriginalPostID-220931

  Discussion posts and replies are publicly visible

  • @raghu

    There is a function like gettaskidforactiveprocess something this ...using this function if u pass process I'd of any process it will return active taskid associated with particular process... in the process you get data using script task and set a email node to send a task link


    This is a way we can neglect task report
  • @raghunandanc There is a plugin by name 'Get Process Task Id' at http://bit.ly/292HgJl which contains a function by name 'getprocesstaskid'.

    I personally opine that fn!getprocesstaskid() is of much use when we don't want to go with creation of report and querying it thereafter. Because fn!getprocesstaskid() has the capability to return the task id based on the process id and design/runtime name of the task which will be accurate provided if the design time task name/runtime name is unique.

    Afaik, fn!gettaskidforactiveprocess() from 'Task Smart Services Plug-in' might not be a great option when the process has got more than one active task(because the function might return more than one task id in this case) as we only need one particular task id to include in the email.
  • Thanks @sikhivahan and @mohammaed. I suppose we can use fn!getprocesstaskid() for each task in a process model when we want to send email (as a parallel node). This will return the current active task's ID??
  • @raghunandanc Yes, you can and to make the design fool proof, make sure that the design time names of the tasks within a given process model are unique. And yes, this gives you the desired task's id.
  • Hi Raghu,

    If you want to bind Task Id with email notification, you can do it easily by following below steps

    1. create constant "cons!MY_TASKS" first

    2. Then use following code to get the current task id of Approval

    "a!queryProcessAnalytics(report: cons!DDG_UserTask, contextUsers: "user_name").data.dp0[1]"

    pass Approval username instead of "user_name" in above code, mention username to whom approval is assigning(or user input task)

    3. These will return you Task id of Approval and then bind with URL of Tempo or Site.