Custom Listener with Jython

Paul Nichols October 21, 2013

I'm totally lost--I might just need a pointer to relevant docs, because I can't find anything. Totally new to Jira and related products.

I've been given the task (and I'm not even sure I have all this right, so if something doesn't make sense please tell me) to fix a bug where when a ticket type is created as task but moved to an incident, the extended reporter information disappears. I'm not even sure where to begin this. I figured it would have something to do with the Script Runner/Script Console, but I can't even get a basic script to run. I tried selecting python (jython, version: 2.7.0, registered extensions: [py]) as the script engine and running the script:

def test():
  print 'this is a test'
  return 'test value'

test()

And I get `Result: no return value` which is odd, and the print statement gives nothing, which is not odd as I have no idea where I should be looking to see the print statement.

Any help with any or all of these issues would be greatly appreciated

1 answer

1 accepted

1 vote
Answer accepted
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.
October 21, 2013

>to fix a bug where when a ticket type is created as task but moved to an incident, the extended reporter information disappears

Roll back a bit - what's "extended reporter" info? If it's a Jira custom field, and you are using the standard built-in "move issue to new issue type" functionality, then the most likely problem is that the field is configured to be valid on Tasks, but not on Incidents, so when the issue type changes, the data vanishes. That could also be the problem if you're doing some sort of scripting too.

Could you confirm what that reporter info is, and how you are doing the move?

Paul Nichols October 21, 2013

@NicBrough Got some more info:

When a ticket is created as an Incident or Simple Request, it includes fields such as Employee ID, Login, Company, Site, Cube and Phone (automatically, based on the Reporter). If it's created as anything else and then moved to an Incident, those fields are not present.

Paul Nichols October 21, 2013

I found this... is it relevant or helpful at all? http://imgur.com/dFitrwT

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.
October 22, 2013

Ah, possibly. It's a plugin providing an unusual type of custom field - one that digs right into a database and pulls information out of it.

However, I don't actually think the type of field is the issue here, I think it's the basic Jira configuration that says "when it's this project and issue type, show this field". In fact, I think the unusual custom field actually simplifies it, because it means we don't have to worry about data, the field should automatically appear when the configuration is correct.

I'm afraid field visibility can be a total PITA to a new (heck, and experienced) Jira admin. You'll need to work through Field configurations, screens and field contexts. It's a bit scary, but start with https://confluence.atlassian.com/display/JIRA/Configuring+Fields+and+Screens

Suggest an answer

Log in or Sign up to answer