--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Matt,
I am using the following Javascript to create a new multi-select customfield within JIRA:
function addCustomfield(name, desc, type, searchKey) {
var i=0;
for (var len=fields.length; i<len; i++) {
if (fields[i].name == name) break;
}
if (i == fields.length) {
AP.require('request', function(request) {
request({
type: 'POST',
url: '/rest/api/2/field',
data: JSON.stringify({ "name": name,
"description": desc,
"type": type,
"searcherKey": searchKey }),
contentType: 'application/json; charset=utf-8',
success: function(data) {
data = AJS.$.parseJSON(data);
if (name == "Gantt Options") {
AP.getLocation(function(location){
var baseUrl = location.replace(/plugins\/servlet\/ac\/de.polscheit.jira.plugins.gantt.cloud\/gantt-chart-configure/,"");
AJS.$("#gantt-customfields").append("<li>"+name+" created, but you have to <a href='" + baseUrl + "secure/admin/ConfigureCustomField!default.jspa?customFieldId=" +
data.schema.customId + "'>create its options</a> named \"Milestone\" and \"Manual re-scheduling\" manually!</li>");
});
} else {
AJS.$("#gantt-customfields").append("<li>"+name+" created</li>");
}
AJS.log(data);
},
error: function(data) {
AJS.$("#gantt-customfields").append("<li>"+name+": " + data + "</li>");
}
});
});
} else {
AJS.$("#gantt-customfields").append("<li>"+name+": already exists</li>");
}
}
addCustomfield("Gantt Options", "Issue-specific Gantt settings", "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes", "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher");
Kind regards,
Frank
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connect-dev+unsubscri...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.