Hi team,
I am trying to set a field description using behaviour for JIRA. I was able to achieve that but the problem is that there is duplication of the description 2 times and i think it is because there is already a field description set by field configuration scheme.
I cannot change what is present in field config because it impacts multiple projects as well multiple issutypes. Can we remove the multi- description via behaviour and override those.
Code i used:-
FormField#setDescription() does exactly as the same name suggests - it sets the description, it doesn't append it. Anything you have in field configuration gets overwritten. Unless for whatever reason someone created new html elements from it with javascript or something.
If there already is the same description, why trying to add it again?
Additionally I'd be curious to see what you're getting in response to the '/rest/scriptrunner/behaviours/latest/validatorsByPid.json' endpoint. Whenever you are creating or editing an issue, an ajax request gets POSTed there, and the response contains a json with behaviour stuff. This should include the field and it's description - just want to see if there it is once, or twice.
Either way, even if you had conflicting behaviours, or field configurations, only the last setDescription invocation will win. I think you have either a custom html block that doesn't "act" as a description (thus the behaviour cannot overwrite it), or something else buggy going on but we would see from the REST endpoint what's coming in.
I dont properly follow on this. There is no behaviour apart from this. So basically what happens is that :-
1. Custom field Members has got a description set already on a global level as "Multi-User picker field intended to help identify useful resources who can inform, advise, review, or help progress the issue."
2. "Start typing to get a list of possible matches." by default it is present for many fields.
So when I write a behaviour to overwrite this, it overwrites 2 times.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did a workaround by removing the description by passing setDescription as empty and then setting the helptext using the html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.