Click Action Buttons with an Action Button?

Just for the sake of logic organisation (and not having the same code in several places) – is it possible to “click” an Action Button from the script of another Action Button? Call it like a method? Since it is created like a field, I figured it should also be accessible from the script like one?

Simple use case: suppose both tasks and subtasks have an “Assign to me” button. By clicking “Assign to me” on a task can I auto-click “Assign to me” on every connected subtask?

If yes, please help me with the syntax for that 'cause I won’t be able to figure it out myself (I don’t know any JS :grimacing:).

Thanks!

1 Like

Hi!
Unfortunately, there is no good way to do that :frowning:

Oh. I see.
Is there a nasty way to do it? :smirk:

Пн, 16 нояб. 2020 г. в 15:06, Polina Zenevich via Fibery Community <fibery@discoursemail.com>:

1 Like

So, instead, I can suggest you a button, that will not click action buttons inside children entities, but that will go through all child entities and will assign the one, who clicked on the button on the parent entity.
That will work.
Unfortunately, for now, we can’t write the whole code, but you can use that ready templates :slight_smile:

  1. Assign to me - assign-to-me · master · fibery-community / Action Buttons · GitLab - to get how to fill in Assignee
  2. Close task and subtasks - close-task-and-all-subtasks · master · fibery-community / Action Buttons · GitLab - this code allows to change State, and you have to customize it and make not change State, but fill in Assignee.

Hope that helps :slight_smile:

@Polina,

How then would you suggest to implement this:

I am modeling a Workflow where I have “Step” entities for the various steps in the Workflow.
Each Step has a collection of “Action” entities that each define an action to take for the “Step”.
When a Step is marked Done (a Button), it must trigger each of its Action entities to take its action, which is also a Button/Rule.

You could have a checkbox field in the Action and define an automation rule that triggers when it is checked (and clears it afterwards).
Then you can have have a ‘Done’ button for the Step that will set the value of the checkbox of all its child Actions to checked.

That’s basically what I came up with – it is nearly the duplicate of a Button, but a “Button” looks nicer and makes more sense for an “Action”, so why can we not just allow the Rules/Scripts to trigger Buttons??

1 Like

Hi, @aprotasenya

That’s a really good idea. Will think about it.

Thanks,
Oleg

4 Likes