Hi,
I need a way to simplify our bug creation on Jira cloud.
I would like many fields defined for the creation flow, but to only display relevant subset of fields that are selected based on a value on a drop down list on the same view.
Example
Bug Create
Source of bug field
Customer
Code Inspection
If the user selects "code inspection", then the view should display fields relevant for customer, ie customer name. If the user selects Code Inspection, then I would like code review URL, file name etc
I understand we could do this on Jira Server with Script runner and behaviours, but we have a cloud instance. Can I instead of this perhaps use a new state in the workflow, so the user selects Source of Bug, clicks Create, then based on the value of the Source of Bug a new screen appears with static fields on it, that are applicable ie a customer screen with customer name on it, that only comes up if the user selected Customer in the create bug screen.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.