Skip to main content
ankushs0002
March 5, 2025
Solved

Can we add expression rule or localvariable using task report

  • March 5, 2025
  • 8 replies
  • 0 views

According to functionality whenever someone initiate the process then we have schedule work order task in which we need to provide the issues with the property and assigned them to the vendors/technisians,

After scheduling the work order if your price is above then 500 then that task goes for approvals(We have to completed 5 approvals to pass that task to the vendor). But in task report when i assigned the task for approvals then it is showing list of taskassignees name but according to my requirements i need to show group name. So i have created a condition as per the task, but my question is can we add this below code in the task report or not.


a!localVariables(
  local!getScope: rule!TSW_getScopeByID(SCOPE_ID),
  if(
    index(local!getScope, "Status", {}) = "Approvals",
    a!match(
      value: rule!MP_getRequiredApprovalLevelByProjectTypeNID(SCOPE_ID),
      equals: cons!TMP_APPROVAL_ROLE_LIST[2],
      then: cons!TMP_APPROVAL_ROLE_LIST[2],
      equals: cons!TMP_APPROVAL_ROLE_LIST[3],
      then: cons!TMP_APPROVAL_ROLE_LIST[3],
      equals: cons!TMP_APPROVAL_ROLE_LIST[4],
      then: cons!TMP_APPROVAL_ROLE_LIST[4],
      equals: cons!TMP_APPROVAL_ROLE_LIST[5],
      then: cons!TMP_APPROVAL_ROLE_LIST[5],
      equals: cons!TMP_APPROVAL_ROLE_LIST[6],
      then: cons!TMP_APPROVAL_ROLE_LIST[6],
      default: ""
    ),
    {}
  )
)

Best answer by stefanhelzle0001

Then you will have to change the assignment to use a group, but not a list of users.

8 replies

stefanhelzle0001
March 5, 2025

No. Process Reports do not support any of the functions in the "a!" domain.

But, the task itself knows to whom it is assigned. Why not use that information?

ankushs0002
March 5, 2025

Right exactly, by using that information i am getting multiple users list but according to the business they wants to show the group name instead of multiple assignees for that task.

It is tuff to get the task group name from all task report.. Can you please advice something.....

stefanhelzle0001
March 5, 2025

Then you will have to change the assignment to use a group, but not a list of users.

mathieud0001
March 5, 2025

It depends what's in those 2 rules

  • TSW_getScopeByID
  • MP_getRequiredApprovalLevelByProjectTypeNID

Personally, I would advise against putting such logic in the Task Report itself if you can avoid it. I would prefer to have that as a PV that is calculated by the process using this rule.

ankushs0002
March 5, 2025

But that task report is for all the tasks that is coming from the all processes...