How to use Constrain for paid ticket permission?

Hello,
how i write a Constrain so that works for me?
I want an automation command to work only if ticket is paid
i tried this: ‘{TICKET STATE:Bezahlt}’ == ‘’
“Bezahlt” means “Paid”

Thanks for help

Bezahlt or Paid presumably is the status state?
If so it would be ‘{TICKET STATE:Status}’ == ‘Paid’ with whatever language changes needed.

1 Like

hi @JTRTech for me then its:
‘{TICKET STATE:Status}’ == ‘Bezahlt’ right?
but its not working yet
Nevertheless the message show if its “==” or “!=”

Can you show image the ticket open when running the automation command?
Specificly the header showing status.

hi @JTRTech i didnt have time to post something…
here some screens

AMC Button

Before using Button

After using Button

did you mean this?

OK, so they its probably because the ticket is not open so it cant see the ticket status.
Maybe explain a little what your trying to do.

Guessing you will either need to instead use a report type expression to get the statis using the command value for the ticket id so it sees what ticket to look at or break apart the rule so it opens the ticket then second rule via an execute automation command action does the following actions.

I want that the Ticket State can only be changed if the Ticket is paid… if not shows a message that the ticket must be paid before

So listen to what Im saying.
Your automation command is triggered on an entity screen not from ticket screen so the constraint on the rule cannot see the ticket status as the ticket is not open.
You either have to use a report expression using the ticket id to get the status or open/load the ticket first then trigger a second rule via and execute automation command after the open/load ticket for a second rule which will then have access to the ticket directly to use {TICKET STATE:Status}.
Your origional post didnt specify the use of entity screen automation command which effects the available info at the point of the automation command.

1 Like

thanks,
can you show me how the report expression could be?

@JTRTech is correct. The Entity Screen does not know the State of the selected Ticket on that screen because it is not loaded.

So you need a 2-part automation flow…

If that first screen is a Ticket Lister Widget, then the Ticket Id will be sent as the [:CommandValue] by default when you click on one of the buttons at the bottom.

Then in the Rule for the Automation Command Retirado, you should Load or Display the Ticket using the Ticket Id ([:CommandValue]), then fire another Automation Command (Call it “Check Status State” or something) using the Status State {TICKET STATE:Status} as the Command Value.

Alternatively, you could use a Report Expression to find the Status State based on the Ticket Id, and store that in a Local Program Setting, then use the Program Setting as the Command Value for the next AMC.

Either way, the second part is a Rule to handle the other AMC (Automation Command) named “Check Status State” …

In the Rule for that other AMC (“Check Status State”), check the Status State (which will now be in [:CommandValue]) using Action Constraints and depending on the State, you perform applicable Actions.

hi @QMcKay thanks for the answer,
i dont understand the workflow you explained…
I need my “Retirado Rule” with Load ticket action with “Command Value”
Then i need a Second Rule with other Load Ticket Action and an Automatioin Command?
And third rule ?

Or 2 AC in one Rule?

2 Rules:

  • Rule 1 ::: used to determined the Status State. This can be done by Loading the Ticket, or by using a Report expression. In this Rule, you will have 2 Actions:

  • an Action that Loads the Ticket, or uses a Report Expression to store the Status State in a Program Setting.

  • an Action that fires an AMC (Execute Automation Command Action), named “Check Status State” for example, and use the Status State (from the Loaded Ticket or the Program Setting) as the Command Value parameter.

  • Rule 2 ::: this is a Rule for the AMC that is fired from the first Rule (ie.“Check Status State”). Here we look at the [:CommandValue], which comes from the first Rule, and it will contain the Status State. We fire whatever Actions are necessary based on the [:CommandValue]. For example, from your first Screenshot, you have several Actions that are Constrained on the Status State. In this case, the Status Sate will be found in [:CommandValue] which we passed from the first Rule as a parameter.

##Rule 1:

Uses Load Ticket Action. IMO, this is not the best way. See Rule 1 (alternate) that follows.


##Rule 1 (alternate):

Uses Update Program Setting Action and Report Expression. IMO, this is a better method.

This is the Report expression:

{REPORT TICKET DETAILS:TS.Status:Ticket.Id=[:CommandValue]}


##Rule 2:

The [:CommandValue] in this Rule will contain either the value from {TICKET STATE:Status} [Rule 1], or the value from {SETTING:TicketStatusState} [Rule 1 (alternate)].

This is the Rule where you perform whatever actions you deem necessary, by constraining the Actions using [:CommandValue].

Wow thank you for the detailed answer @QMcKay

Yeah! It works thank you!

I have another question about an “ask question” action… and if i understand it right then in a “ask Question” Action if i put an “Cancel” Button then the AMC will not fire is that right?

It depends on your constraint for that AMC. If no Command Value in the constraint then it will execute.
The button you click will pass that value as Command Value.

ahahahahaha i answered my own question!!!
I used not “Cancel” i used “No” with “Cancel” it works but with “No” not. :smiley: lol

Oh i was a little too fast, no that has nothing to do with the other question…

i mean this…

If i put “No” or “Cancel” neverthless the command is fired…

Show the rule for the ask question command name.