How to create a scheduler at specific date and time based on the input from user in frontend(forge Jira Issue panel)

Hi Team,

In jira, we want to create a scheduler at specific date and time based on the input provided by user in frontend (Jira Issue panel) App.

Thanks in advance.

Regards,
Suman C.

Hello @SumanChinnaraju

When you say a ‘scheduler’, are you referring to Scheduled Triggers?

Hi @sunnyape,

Thank for responding. Yes I am referring to Scheduled trigger but the documentation only refers to scheduled triggers which are preconfigured (manifest.yml) in the app but, we are supposed to create a schedule at specific date and time which user will select in the frontend(Issue panel App).

Thanks,
Suman C.

Sorry, but I don’t know how that would be possible, since, as you have already discovered by reading the module’s documentation, Scheduled Triggers:

  1. Cannot be set to happen at a specific date and time, only a recurring interval; and
  2. Can only be pre-defined via the App’s manifest.

You seem to have answered your own question.

1 Like

Well, you can have a scheduled trigger that runs as frequently as possible (aka every hour) and does nothing on its own, but fetches a list of user-defined triggers and sends an event if one of those cron jobs should start.
Keep in mind that you wouldn’t be able to specify the exact time since the granularity can only go as low as 1 hour, so you’ll have to adjust for that

1 Like

Hi @PaoloCampanelli,

Thank you for suggesting a approach to achieve our usecase.

Can we use node package like ‘node-cron’ in jira forge app for creating a scheduler at specific date and time.

Thanks,
Suman C.

No and yes.

No, if you want to keep with only Forge native capabilities (without Forge Remote). Between the compute model of functions-as-a-service and the existing events, there isn’t anything that’s going to run your function frequently enough to be triggered at the precision of anything under an hour. The node-cron package won’t change that.

Yes, if you would be willing to use Forge Remote, where you can keep your own “clock service” running and send “messages” into the Forge app when your own service knows the time is right.

Regardless of what’s doing the timing, I think you could quickly find yourself running into the Forge quotas and limits with chatty tasks that run frequently. Even hourly tasks could quickly eat up invocation limits. If you use Forge Remote anyway, you might offload logic into the remote as well, and keep the Forge functions to a minimum for the purpose of serving UI.

1 Like

HI @ibuchanan,

Thank you for answering.

Is there any way in forge where we can achieve our use case(“create a scheduler at specific date and time based on the input provided by user in frontend (Jira Issue panel) App”) without using the forge remote.

Thanks,
Suman C

You can’t archive it directly, but I have a workaround for you. It’s a bit unconventional, so use it carefully! :wink:

  1. Save all timers created by the user in the Jira Issue panel to Forge Storage.
  2. Create an automation rule that runs on a scheduler as frequently as possible (it can run as often as every minute).
  3. Set up a web trigger to check which timers in storage need to be activated and what actions should be applied.
  4. Add a “Send Web Request” action to your automation rule that will call your web trigger.

Just keep this solution between us!

3 Likes

Thank you @AndreiPisklenov