Plugin 'ScriptRunner' defined a function with the name: 'hasattachments' but one with that name already exists.

Description

*This issue has moved*

This issue has been moved permanently to Adaptavist's Product Support JIRA instance.

All existing users of this instance should have the same username on our Product Support instance. However, you will very likely need to click on the
Can't access your account link in order to reset to a new password.

Environment

jira-6.4.4

Activity

Show:
Jamie Echlin
September 16, 2015, 3:38 PM

OK... I'm going to close this because it's not in my powers to fix.

https://jira.atlassian.com/browse/JRA-24219 is the closest issue I could find, and I added a comment.

Regarding your points:

> Sometimes the competing functions operate in different ways and so you really do want to have access to both!

That's not possible, unless you want to do some coding, eg override one of the built-in functions to give it a different name. Besides, I think it would be very confusing to the users.

Points 2) and 3)

Filters should not break, if another plugin provides hasAttachments for instance they will continue to work.

I have added to the documentation more information on what to do in this scenario, it will be available at the next release.

Mark Symons
August 8, 2015, 4:11 PM

, I totally understand that the problem can ultimately only really be addressed by Atlassian themselves... by providing a framework where JQL functions provided by different plugins cannot clash.

I have not been able to find a logged issue relating to this on jira.atlassian.com.

Could I beg a favour? That you be the one to log the issue... thus ensuring that the wording is couched optimally. Then we can all go and vote the the issue!

It does help that Scriptrunner now allows selective disabling of modules such as "Scripted JQL Function - hasAttachments". That was not possible when I first ran into the "JQL Function clash" a couple of years ago. However, it's a workaround that has three problems:

  1. Sometimes the competing functions operate in different ways and so you really do want to have access to both!

  2. Disabling a function will break filters that use that function. Is their a way (scriptrunner script?) that will identify such filters?

  3. Disabling a function will break queries used in Confluence's "JIRA Issues Macro".

Jamie Echlin
July 5, 2015, 7:53 PM

Not really... it may be that you are upgrading SR, in which case that function would already be defined. Besides, you could ask the author of JQL tricks to check the same thing.

If I am so cautious but no one else is my functions would never win. It's up to the users to decide which ones they want, but ultimately i's an issue for Atlassian to solve.

Sorin Ionuț Sbârnea
July 5, 2015, 2:56 PM

Is not possible to check if a function name is already registered? I guess it should be possible even if with just a JQL execution. If the hasattachments is not defined, it should enable this module.

Answered

Assignee

Jamie Echlin

Reporter

Sorin Ionuț Sbârnea

Labels

None

Internal Complexity

Unknown

Internal Value

Unknown

Fix versions

Affects versions

Priority

Major