Custom JQL functions name cluttering

Jozef Kotlár
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.
January 7, 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
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.
January 7, 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 https://jira.atlassian.com/browse/JRA-30853 !

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.
January 7, 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
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.
January 7, 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
Jozef Kotlár
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.
January 8, 2013

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

0 votes
JamieA
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.
January 7, 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
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.
January 7, 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
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.
January 7, 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
JamieA
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.
January 7, 2013

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

Suggest an answer

Log in or Sign up to answer