"Change work item status" automation fails for Team-managed projects if a project-agnostic status was selected in the definition
Description
If an approval includes "Change work item status" automation which is supposed to change the ticket to a non-project-specific status, it will work correctly for Company-managed projects. However, if it is triggered for a Team-managed project it will fail with a "Error occurred during Automation Step: Transition not found for status with id: # and name: <status name>" message.
Steps to reproduce:
-
Create an approval definition and add an Automation
-
In the Automation pick Action: "Change work item status" and select a status that is not project specific
-
Finish creating the definition
-
Run the approval on any ticket in a team-managed project and have it trigger the automation
Change
-
"Change work item status" now moves a work item in a team-managed project when the definition holds a global status. If no available transition leads to the saved status id, the step finds the transition whose target status has the same name (ignoring case).
-
Transitions are still fetched once. The status name is read only when the id does not match.
Decisions
-
The saved status id still wins over a status with the same name.
-
If no available transition matches by id or by name, the step ends with the same "No available transition leads to status..." error as before.
Manual tester notes
-
In a team-managed project, make sure a status named "In Progress" exists in its workflow.
-
Create an approval definition with an Automation step: Change work item status. In the status picker choose the global "In Progress" (the entry without "project specific").
-
Start the approval on a work item in the team-managed project and approve it. The work item moves to "In Progress" and the Automation step shows no error.
-
Repeat on a work item in a company-managed project. It still moves to its "In Progress".
-
Choose a status that does not exist in the team-managed project's workflow. The step shows the "No available transition leads to status..." error and the work item stays unchanged.