what is the listener fired when we change the project from the project field while creating the new issue?

sohil chhabriya March 13, 2013

I have a custom field (select list, a dropdown), with multiple values. I want to set a default value for every project in the custom field dropdown list.

I want to use some listner to fire when the project is selected from the project field while creating an issue.

eg: my projects are apple,orange,banana

and list of my custom field values are is orange,red,yellow

so when i select "apple" automatically the custom field default value should set to "red". and for "orange" become "orange" and for "banana" - "yellow"

3 answers

1 accepted

0 votes
Answer accepted
sohil chhabriya March 18, 2013

Create a listener(workflow listener) which works on the issue event and update the custom field value

1 vote
Jobin Kuruvilla [Adaptavist]
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.
March 13, 2013
sohil chhabriya March 13, 2013

Thanks jobin for your valuable Reply.

i also wanted to know,

when a value of a custom field(a dropdown) is changed -- normally we say it as a onChange function in javascript.

which listener is to be placed into action while we edit the custom field and do certain task, that i define into its function when my custom field value has got change.

Jobin Kuruvilla [Adaptavist]
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.
March 13, 2013

You can capture custom field option changes only using javascript. Or in a listener after the issue is submitted. What are you trying to achieve?

sohil chhabriya March 13, 2013

well its very troubling situation i have stucked up in...

well i have customized my jira with adding a custom field (a select list) into my create issue form. The values of the custom field are common for all the projects. But for every project there is certain default value within the custom field select list. My need is to automatic select the default value in the custom field to get selected when i change the project selection (in create issue form).

----for which you have give me solution already

Now the another requirenment i am comming up with is to change the project automatically when i edit my custom field value.

i explain it in simple words------ after an issue is created on the view issue page when i change the value of the custom field then automatically the associated project should be assigned to the issue..
in other words its a move issue on the custom field selection

eg: i have 2 dropdown interdependent
[project]--country: india, usa, uk, japan
[custom field]--city: delhi, ny, london, tokoyo

on change of country i wanted city to show delhi as default, and after issue is been created then on edit issue "i wanted to change the country if i change my city from delhi to london"...

hope i am clear with my question....

solution that i think would be applicable is to fire a listener on the change of the custom field value and update the project key value, followed by re-indexing the issue.

thanks to give time to this query!

Jobin Kuruvilla [Adaptavist]
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.
March 13, 2013

Changing project is much more than just changing a select list. This is possible only via some javascript but I wouldn't recommend it.

And also with the different custom field options per project, you won't be able to select 'NY' when the project is 'India'.

sohil chhabriya March 13, 2013

Thanks jobin

"And also with the different custom field options per project, you won't be able to select 'NY' when the project is 'India'."

i mean that all the cities are always available in the custom field. custom field list is common for all the projects. if i have selected say: india- default in custom field should be delhi. but i manually can select NY also thats up to me.

"Changing project is much more than just changing a select list. This is possible only via some javascript but I wouldn't recommend it."

yes i know its not just to change a list option from one project to another. here is where i am facing a problem. in fact i am finding to add some listener plugin in my jira. Which Listener can catch when the custom field value is been edited from the view issue form?

0 votes
sohil chhabriya March 17, 2013

sorry jobin the method is not working properly!

I feel it has to be done throught the listener , programming, plugins etc

the custome field is not getting changed when we are changing the project field....

Suggest an answer

Log in or Sign up to answer