It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Custom JQL functions name cluttering

Jozef Kotlár Jan 07, 2013

Script runner is adding custom JQL functions in version 2.1.

I would like to point out one aspect of new functionality. Maybe I am wrong, but JQL functions are slightly different from scripted fields, as names of custom fields are fully in control of administrator.

Another plugin could bring in JQL function which will clutter with user defined function. I don't know how will JIRA handle this situation, but I think it will lead to misunderstandings in the future.

I would suggest to automatically prefix every user defined name with some prefix - say if_. What are others thoughts?

6 answers

1 accepted

0 votes
Answer accepted
JamieA Jan 07, 2013

Hrm.... I have kept it to a minimum, there aren't very many functions (although each one can do a lot).

Also, the majority of them will only appear if you enter "issueFunction in ...", and not "issue in ...". (If not, which version are you using?).

However there is only one namespace for jql functions, so it's possible for one to trample on another. This has been discussed before... also there is only one namespace regardless of the type the function supports.

BTW if this is specifically about scriptrunner, you can disable individual functions in Admin -> Scripted JQL Functions, or disable the whole lot by disabling the plugin module.

> I would suggest to automatically prefix every user defined name with some prefix - say if_. What are others thoughts?

I think that would be a poor experience for the users, and means you need to type X characters before even getting anything meaningful from the autocomplete. What does the if_ mean in your example?

What I think is that there should be a nicer way of picking functions, and with getting help on the arguments.Vote for !

Nic Brough [Adaptavist] Community Leader Jan 07, 2013

... votes ...

I think it's immensely clunky to start messing around with function names with prefixes and subscripts. Keep them simple and flexible. But having a help text available while you're trying to work out what you're doing is a really good way to solve the problem. Users can be informed exactly what they're doing and you can use nice names for functions.

Jozef Kotlár Jan 07, 2013

You are right - if are talking about issueFunction related functionality - those function will really appear only in that context. Well, if_ = issueFunction ;-)

Those literal generating functions were of my concern. I was writing that question when I was trying to recall what function it - hasLinks or linkedIssuess, or what the hell. Anyway, JQL editor is of help there as it is offering only functions for the given field type.

Ah - voted for inline help - this would help heavily.

0 votes
JamieA Jan 07, 2013

But good question. Just a reminder that 2.1 is actually 2.1-BETA... still finalising.

0 votes
JamieA Jan 07, 2013

Oh, good spot on the custom field thing. It was the only way possible to do it and get good performance, plus flexibility. Some day I will write a followup post to the discussions we had about jql functions. There are no leones, I've slayed them all ;-) But seriously, if writing your own function you have a choice to use "issue in ... " and return a list of QueryLiterals, or issueFunction and return a lucene query. There is a massive performance "bug" with issue functions imho.

0 votes
Jozef Kotlár Jan 07, 2013

Yes I analyzed it quickly and found those two possibilities. There is some problem with rendering source of provided functions so I haven't dig deeper to query construction internals.

0 votes
JamieA Jan 07, 2013

Hrm... works ok for me. Let me know about any error if you like. Most of the code is shipped uncompiled so you can look in the jar too.

0 votes
Jozef Kotlár Jan 08, 2013

Oops, my fault - view source for built-in JQL functions works as expected.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

1,258 views 2 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you