const response = await SR.request('/rest/api/3/field');
console.log(`Response: ${response.status} ${response.statusText}`);
const result = await response.json();
const response = await SR.request('/rest/api/3/field', {
headers: {
'Accept': 'application/json',
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
const result = await response.json();
Replace default export PDF result with specifying “jsPDF” object for export. If set, this method replaces pdfmake export that’s used by default.
const doc = new jsPDF();
doc.text("Hello world!", 10, 10);
SR.pdfDoc(doc);
// expected result: export to pdf default function will be replaced with
// a new formatted document.
By default SR uses pdfmake library for export. You can configure PDF layout with specifying PDFmake configuration object (for example, page format, page margins, landscape/portrait mode, watermark, etc).
SR.pdfOptions({
pageOrientation: 'landscape',
pageMargins: [20, 15, 20, 15],
});
// expected result: page orientation of pdf to be landscape
// and margins [left, top, right, bottom] to be applied.
Pass script variables and the callback to the template engine. Based on the idea of expressions from the handlebars.
SR.render({ doesWhat: "rocks!" });
SR.render({}, () => {
document.getElementById("element").innerHTML = 'Updated from callback';
});
// expected result: the text of the element with id 'element' must be replaced with 'Updated from callback'
Request function for getting data from jira REST API
Documentation for Atlassian Jira Rest API