Dmitry Pashkevich
AJS.whenIType('ze').execute(function () {
alert('I have executed.');
});
AJS.whenIType('c').click('#create');
AJS.whenIType('gh').or('gd').goTo('http://example.com/');
AJS.whenIType('n').moveToNextItem('.selector');
AJS.whenIType('p').moveToPrevItem('.selector');
AJS.log("Panel initialized.");
AJS.format("Have a {0} day", "good");
AJS.$('#confirmPrompt').hide();
lucidAc.jira.listAttachments(
ISSUE_ID
).done(function(responseText) {
// got a successful response,
// render diagram attachments panel...
}).fail(function(xhr, message, error) {
// show error message to the user
apMessages.error(
'Lucidchart Diagrams',
'Failed to load attachments. Error thrown: ' + error
);
// log extra details in the console
AJS.error(
"Lucidchart",
"Failed to load attachments at " + attachmentsUrl,
message,
error,
xhr.responseText
);
});
val attachmentEither = client.addAttachment(/* ... */)
attachmentEither.fold(
errorResponse => {
val statusCode = errorResponse.statusCode
logger.error(
"Failed to create attachment. Response from JIRA server (consumerKey=%s, status='%d'): "
.format(consumerKey, statusCode)
)
if(statusCode == 401 || statusCode == 403) {
// Unauthorized - most likely problems with addon user permissions
InternalServerError("Failed to create attachment, check add-on user permissions...")
} else if (errorResponse.body.contains("exceeds its maximum permitted size")) {
// Hit attachment size limit...
InternalServerError("Unable to create attachment. Size limit is exceeded, ...")
} else {
InternalServerError("Unknown error. Please try again")
}
},
attachmentList => {
Ok(/* ... */).as("text/json")
}
)