JIRA AUI / AJS script not loaded and field not searchable

Mokuyobi August 25, 2013

I got two serveral questions about the Atlassian JIRA SDK Api.

1.) I have a working Version Custom Field Type - but - I did not get it searchable. I read the j-tricks article but for me it doesnt work. I always get exceptions. (i am extending abstractMultiCFType - i heard that it maybe works with abstractsinglefieldtype?)

2.) AUI / AJS: It seems that if you open the create issue dialog and _then_ change the project to the one with your customfield on it, the ajax doesnt affect the dom element at all. if you close the dialog and reopen it, the ajax works (=> i have a select-tag with some options. first its like a normal select-tag although i used:

<script>
	(function($) {
		AJS.$("#$cid option[value='-1']").remove(); //Removes the default value "None"
		
		function convertMulti(id){
			if (AJS.$('#'+id+"-textarea").length == 0){
					new AJS.MultiSelect({
						element: $("#"+id),
						itemAttrDisplayed: "value",
						errorMessage: AJS.params.multiselectVersionsError
					});
			}
		}
		
		AJS.toInit(function(){
			convertMulti("$cid");
		})
		
		JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
			AJS.$("#$cid option[value='-1']").remove();
			convertMulti("$cid");
		});
	})(AJS.$); 
</script>

).

1 answer

0 votes
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 25, 2013

i am not sure about searchable custom field type

coming to javascript, you have to load it as a webresource module

check this

https://answers.atlassian.com/questions/47843/strange-javascript-problem-in-create-screen

Suggest an answer

Log in or Sign up to answer