How to get current task name

Hello everyone, 

I would like to get the name of the current task, for instance in connector in / out script.

 

How is it possible to proceed ?

 

Thank you !

Hi,

You can retrieve those using the apiAccessor.

apiAccessor.processAPI.getActivityInstance(activityInstanceId).displayName

apiAccessor and activityInstanceId are injected in the evaluation context at runtime.
You can retrieve a list of provided variable of a script in the Execution Context category of the script editor left panel.

HTH
Romain

`displayName` may not be available since you don't configure it in portal section of your task

`name`is always available and can't be modified, I suggest to use it instead of `displayName` that can lead to error if operation behind is wrong