Hey, guys!
What I want is to create custom button which is the same like Component/s button:
So I need to have the content of Component/s button and behaviour of Component/s button in custom button.
I've tried to create a custom button and put this code inside of "Description":
(function($){
new AJS.MultiSelect({
element: $("#customfield_10653"),
itemAttrDisplayed: "label",
errorMessage: AJS.params.multiselectComponentsError
});
})(AJS.$);
However, the above code is not working and I see just the above code.
Guys, how can it possible to create custom field like "Component/s" button?
I have an option to use ScriptRunner.
Hello @zaharovvv_suek_ru
As I can remember, you are using scriptrunner
Component/s field it's just like labels field, so why not try to create labels field that will be populated from components via listener on Issue Update event?
@Mark Markov yeah, you are right!
Thanks for your reply.
It sounds really good. However, I am not really aware how it is possible to populate by components and what does "via listener on Issue Update" event. Could you be very kind to clarify that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jira based on event architecture. When something happens(changes) in system, jira thtows an specific event(for example, when you made some changes to the field values, jira throws ISSUE_UPDATED event), that can be caught and processed by listeners. To make listener with Scriprunner go to add-ons -> Script listeners -> Add -> Custom script listener
Project key: What project lister will be affect
Event: On what event it will be triggered (in your case Issue Updated)
Inline/file script: And your script that will do all kind of magic you need.
Here is example of script that will catch changes of Component/s field:
def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "Component"} if (change) { log.debug "Value changed from ${change.oldstring} to ${change.newstring}" // your actions if the field has changed }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@ Huge thanks! You make it clearer! Now it is really clear about events.
However, is it possible:
1. To get components and populate custom field by this components? I mean like Components field.
2. To have behaviour like Components field - when I input letter in custom field, then autosuggestion of components will work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @zaharovvv_suek_ru ,
Did this work in your case , coz I am also having similar requirement, if not, then what was the thing that worked.
Thanks in Advance,
Nasreen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@zaharovvv_suek_ruYou don't need to create a new one, we have the component/s
field,
Why you want to complicate things ?
Best!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Moses Thomas yeah, I know, however I was asked by my chief to create the same custom field "ComponentsLinked" which looks exactly the same like "Component/s" field and set Components value in that custom field.
So I cannot protest to his requirements.
Is it possible to create such a field?
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.
Please KB article on how to add new custom field Add custom field
What do you hope to achieve? component field is a system field by default.
Best
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply, Moses. I can add custom field, however I cannot create a custom field which is populated by components.
What I want is to create custom field "ComponentsLinked" which looks exactly the same like "Component/s" field and set Components value in that custom field.
How can I do it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.