Block/Stop completion of workflow on purpose
Hi, lets say that we have a custom rule in a workflow that includes all functions needed for all the other on change,action, rules.
In this custom rule we could have dependent functions (i mean logical dependent). As example we need to get from rest api version of a system which could be done at the moment. Then the rest of the functionality should not run.
So at this point is only a throw "Exception" functionality enough or is there any better or proposed way to do it.
What u described is not in a guard or probably all the intermediate steps should be placed in the guard of the main rule?
Please sign in to leave a comment.
I'm Lena from the YouTrack Team.
I suggest you take a look at the getSync method: https://www.jetbrains.com/help/youtrack/devportal/v1-Connection.html#getSync. Please try it and let me know if it is what you are looking for.
What to check there you even did not point me somewhere that i did not already read, did you read the question it is not at all about get function of http?
I am sorry that i answer like this but It is the second time that you address an issue or question with foggy or irrelevant request.
Last time i tried to explain that there is issue with workflow editor and mac os and chrome. Which still exists and i am working from safari since there is no issue there. I closed the request cause you where asking for things that i could not provide clearly you did not even try to reproduce anything.
This bad reponse for potential clients. if you do not like this request to switch position
I will try to give some more info. If we use throw exception yes we can block the execution but the Message shown to the users is about the line of code that had the issue and the real message is not visible in screen. So you have to go to open the console of the workflow to see what it is. And normal users should not touch this.
"line of code that had the exception"
I'm sorry for the misunderstanding. In your initial message, you mentioned:
>As example we need to get from rest api version of a system which could be done at the moment. Then the rest of the functionality should not run.
It looks like this misled me, and I suggested you a method to help implement this example. Could you please clarify if you are looking for any method which allows you show any custom message when further execution is not possible because of the exception?
Custom message can be done with workfow.message this is not the question. The questionis that a will get a rest api response in a step of my workflow . I do not want to proceed with the rest if i get something ton proper. So one way is on next function to control everything witb if condition and on elsd to leave it empty but this does not really blocks tge workflow run just it allows to do nothing until the end. I am searching for something except throw exception that can stop workflow with a message. Throw exception does it but the message can not be show cause the size of the alert is small enough to keep the standard message of the throw which tells you where gge code broke
According to the description, I can assume you wish to have something like the `try...catch` statement. You can use this [JS statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch) in our workflows. Please let me know if I got you correctly.
Sorry what do you think that i would have ask you to send me tutorial for try catch??
Please request from another engineer or agent to check the post and respond. If also another agent confirms here that does not understand anything then i will try to explain again, else it seems to me that there is a deadline that for each comment of a client you have to answer something in 24 hours and in order to be compliant you are typing something irrelevant if you really read what the client wrote
I discussed your case with our colleagues, and except for the `try..catch` statement, you can use the workflow.check() method: https://www.jetbrains.com/help/youtrack/devportal/v1-workflow.html#check. It will work only if you know the condition when further execution should be stopped. Unfortunately, based on your description, we don't have anything else to suggest to you at the moment.
>it seems to me that there is a deadline that for each comment of a client you have to answer something in 24 hours
You can read about our SLA policies here: https://youtrack-support.jetbrains.com/hc/en-us/articles/210660509-Support-Workflow-and-Response-Time-SLA