Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Schedules a run script task to be run asynchronously for the given script and returns a ScriptScheduledResponse. To run in the context of an issue, pass a property with the key "sil.issue.key" and value with the issue key.

ParameterTypeRequiredDescription
source

ScriptSource

yesThe script to run
propertiesarray of objects containing "key" and "value"no
Code Block
titleexample properties
"properties": [
	{
		"key": "sil.issue.key",
		"value": "TEST-1"
	}
]
argsarray of stringsnowill be passed into the script as the "argv" variable


Code Block
titleExample Request using AJS
AJS.$.ajax({
 type: 'POST',
 contentType: "application/json",
 url : "http://localhost:7210/rest/keplerrominfo/refapp/latest/async-script/runScript",
 data : JSON.stringify({
   source: {
   	type: "FILE",
   	code: "example.sil"
	}
 }),
 success : function(data) {
    console.log(data);
 },
 beforeSend: function (xhr){
     xhr.setRequestHeader('Authorization', "Basic " + btoa(username + ":" + password));
 }
});



Code Block
titleExample JSON Response
{
 "key" : 4
} 


...

ParameterTypeRequiredDescription

source

ScriptSource
yesThe script to run
propertiesarray of objects containing "key" and "value"no
Code Block
titleexample properties
"properties": [
	{	
		"key": "sil.issue.key",
		"value": "TEST-1"
	}
]
argsarray of stringsnowill be passed into the script as the "argv" variable


Code Block
titleExample Request using AJS
AJS.$.ajax({
 type: 'POST',
 contentType: "application/json",
 url : "http://localhost:7210/rest/keplerrominfo/refapp/latest/async-script/runDetachedScript",
 data : JSON.stringify({
   source: {
   	type: "INLINE",
   	code: "return 1;"
 }
 }),
 success : function(data) {
    console.log(data);
 },
 beforeSend: function (xhr){
     xhr.setRequestHeader('Authorization', "Basic " + btoa(username + ":" + password));
 }
});



Code Block
titleExample JSON Response
HTTP 204 No content


...