fields should change dynamically wen creating ticket based on my previous field selection

ANKITA BARBI November 23, 2016

Hi 

wen i am creating tickets there are multiple fields so based on my above field selection value , the fields should change and i should be able to create the ticket. I am using JIRA 7.2.1. how do i do that? Plz guide me.

2 answers

0 votes
ANKITA BARBI December 27, 2016

Hi Nic,

Thanks for the reply. Now things are all working fine. I had to make changes in the java scripts after the upgrade (as suggested by you) to make it compatible with the upgraded version. As far as .jsp files are concerned, that is also working fine (some of the libraries were missing, so had to add them to make it work). Cheers for guiding me smile Thank you again..

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2016

The only fields that support that natively are

  • "issue type", because the fields on an issue are determined by the project and issue type, so changing the issue type can mean it needs to ask you for different fields
  • Cascading select lists, which are a pair of entry fields, the selection in the first determining the available choices in the second

For any other dynamic field changes, you need code.  The standard doc is on https://confluence.atlassian.com/jirakb/how-to-display-a-field-based-on-another-field-s-selection-649921383.html  but I'd usually reach for the "Behaviours" module in the Script Runner add-on, because it's easier than writing javascript and more likely to work after an upgrade.  (and, personally, because I can go ask Jamie's team when I get stuck)

ANKITA BARBI November 24, 2016

Hi,

Thanks for the reply. Actually it was done in JIRA 4.4.3 but later it is upgraded to 7.2.1. and java scripts associated with custom fields are not wrking now.

Based on my project and issue types, below given fields change. but for one of the below given fields selection, others have to change. Since the java script is written and it is in prod env. plz help me with tweaking the things around.

Is there a way to run those java scripts . plz guide me. ur support is much appreciated.

 

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 24, 2016

You will need to rewrite the javascript for the new versions, probably from scratch.

ANKITA BARBI November 27, 2016

Hi,

why do i need to rewrite the java script again after upgrade? What will change? I am not clear about it as my logic will be same rite?

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 27, 2016

Your logic might be the same, but the javascript libraries and apis can (and often do) change with even the smallest JIRA upgrade.  With a jump from 4.2 to 7.2, I can absolutely guarantee you that they have, and if your code relies on anything JIRA provides as part of its UI, then it will need to be rewritten to suit that UI.

ANKITA BARBI November 30, 2016

Hi Nic,

Thanks for ur suggestion. We are actually rewriting the script as it depended on JIRA UI. But I again have a doubt. In the previous version my .js files were reading .jsp files created by some folks in organization but now wen I try to read .jsp files , it does not allow. it throws 500 error code. I even tried to hit in the browser , the previous version it allows but the new version does not let me hit also. Do u have any idea as to why this would be happening?

Does it have to do with permissions in the server or wat?

If u can throw some light to it, it would be great sir.

 

Regards,

Ankita

 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2016

It's because the jsp files you are trying to use have moved, or been dropped.

I'm not sure why your "dynamic field" stuff needs to be reading other pages, but it's the wrong approach.  You should be sticking to working on the page you are on, and in the rare case you need data (not pages, just data) that is not available there, use the REST API to request it.

Or, better, stop trying to kludge complex behavioural changes into JIRA.  Or lean on something built for it like Script Runner.

ANKITA BARBI November 30, 2016

Hi,

I can not make changes to it. I am bound to use it the way it is. Its been in use in the organization for the last 6 yrs.

The .jsp files are there  because  wen i go to the server and to the path, i can see the file. It is placed in installation directory of JIRA under atlassian-jira.

The. jsp files in return gives data that is auto filled in create ticket modal. But I am not able to read it now. but it is there in server. 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2016

I'm sorry, but it's not going to happen.

These pages have been bodged in, badly, in the past, and then used by unsupportable javascript.  You've now moved to a newer version that does not support these bodges.  You'll need to find a way to make your bodges work, or, do the right thing and redesign the approach into a supportable method that does work.

Suggest an answer

Log in or Sign up to answer