Update State custom field of an issue via Rest api( inProgress to Closed)

issue_data = {
   "customFields":[
           {"name":"State","$type":"StateMachineIssueCustomField","value":{"name":"Closed"}}
      ]
}

while running above code, it is executing successfully, but the change is not reflected on YouTrack portal. Kindly help me with this. 

Thankyou,

Graj 

0
5 comments
Hello,
I'm Lena from the YouTrack Team.
Could you please specify why you use the StateMachineIssueCustomField type? Did you try the StateIssueCustomField instead?
0

while using StateIssueCustomField  i am getting an error shown below:

Failed to create issue. Status code: 500
{"error":"server_error","error_description":"class jetbrains.charisma.customfields.complex.state.StateIssueCustomFieldMegaProxy cannot be cast to class jetbrains.charisma.workflow.statemachine.StateMachineIssueCustomField (jetbrains.charisma.customfields.complex.state.StateIssueCustomFieldMegaProxy and jetbrains.charisma.workflow.statemachine.StateMachineIssueCustomField are in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @7eed61f7)"}

 

I have initially used GET request and in response i got  $type of State as StateMachineIssueCustomField. 

Below shown is the response of GET Request:

"customFields": [
       {
           "value": {
               "name": "Closed",
               "$type": "StateBundleElement"
           },
           "name": "State",
           "id": "117-578",
           "$type": "StateMachineIssueCustomField"
       }

]

 

Thank you,

Graj .

0
Hello,

Do you have the State machine workflow with this field? If yes, please make sure that it allows you to change the values from in progress to closed.
0

Yes we have the state machine workflow under workflow rule type  with this field, But i am unable to understand how to allow it , to make the change from in progress to closed.

Please, Can you provide a detailed steps to perform above task.

0

Hello, 

Could you please contact our Support Center directly: https://jb.gg/ytsup ? It looks like for further investigation, we require some personal information. 

0

Please sign in to leave a comment.