Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set Scheduled Job Parameters on the Customized UI

hongchao song May 25, 2018

Hi guys,

    We have a requirement that regarding schedule task, and found there is a Job Module seems to available for JIRA application,  is it correct?

   And furthermore we plan to configure schedule job parameters on the Customized UI but not in the atlassian-plugin.xml file,  is it possible?

   Any thread is appreciates. 
   Thanks in advance.

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
May 26, 2018

Hello,

If you're writing your own plugin, it is possible. You can change scheduled task's parameters via UI.

Assume you have MyScheduledTask

public class MyScheduledTask implements JobRunner{
String parameter = "DEFAULT_VALUE";

public void register() {
parameter = getStoredParameter();
/* do something.... */
schedulerService.registerJobRunner(...);
schedulerService.scheduleJob(...);
}

public void unregister() {
schedulerService.unregisterJobRunner(...);
}

public JobRunnerResponse runJob(JobRunnerRequest request) {
/* do something */
}

}

From your UI,

- save stored parameter, scheduled task will read the value via getStroredParameter()

- call scheduled task's unregister and register methods in order.

It should work

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events