Hello Alessandro Donisi,
Actually we do not have special service or command to update state by name. So you need to find out a proper entityState.id.
From any assignable you can get its entityType.id and workflow.id for e.g. by following request
/api/v1/assignables?include=[entityState[workflow],entityType]
as a response you may get smth like
<Assignables>
<Assignable ResourceType="Assignable" Id="209">
<EntityType Id="4" Name="UserStory"/>
<EntityState Id="73">
<Workflow Id="10" Name="Project workflow"/>
</EntityState>
</Assignable>
<Assignable ResourceType="Assignable" Id="218">
<EntityType Id="8" Name="Bug"/>
<EntityState Id="93">
<Workflow Id="12" Name="Project workflow"/>
</EntityState>
</Assignable>
</Assignables>
suppose you get workflow id equal to 10 and entityType equal to 4 (UserStory) and you looking for state with name 'Planned'
/api/v1/entityStates?where=(entitytype.id eq 4)and(workflow.id eq 10)and(name eq 'Planned')
so in a result you may get the following
<EntityStates>
<EntityState Id="74" Name="Planned">
<IsInitial>false</IsInitial>
<IsFinal>false</IsFinal>
<IsPlanned>false</IsPlanned>
<IsCommentRequired>false</IsCommentRequired>
<NumericPriority>74</NumericPriority>
<EntityType Id="4" Name="UserStory"/>
<Role Id="1" Name="Developer"/>
<Process Id="3" Name="Scrum"/>
<ParentEntityState nil="true"/>
<Workflow Id="10" Name="Project workflow"/>
</EntityState>
</EntityStates>
Be aware that entity state is unique across {process, entityType, name} triple, so Planned state for Bug is not equal to Planned state for UserStory even in same process.
Best Regards