CustomField in JIRA Servicedesk Customer Portal

Lennart Rosam January 15, 2014

Hello everyone,

I am developing a custom field plugin for JIRA 6.1.5 that pulls in additional information for a ticket from LDAP sources (reference person contact information to be exact). It is a regular text field and when typing in something, the LDAP server gets queried and autocomplete options will be shown.

The plugin itself is working fine. The text field gets shown on the create issue screen of our service desk project. However, I am unable to add the field to our Service Desk customer portal (Service Desk 1.1.6). When clicking "add field", it is simply not showing up as an option. The field is associated with the create screen however.

I have allready found this: https://jira.atlassian.com/browse/JSD-84

Does that mean that it is impossible for plugin fields to be shown in the service desk view? Or must I develop my field class from a more specifc class Like GenericTextCFType ? I am currently extending AbstractSingleFieldType.

Any pointers on this would be greatly appriciated.

Cheers,

Lennart

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Lennart Rosam January 20, 2014

Hi Brad,

thank you very much for your detailed explanation. I can see why this is currently not meant to be possible and I am looking forward to future releases. However, during the time it took to get this question out of the spam robot, I did actually manage to get my custom field to show up in the service desk customer portal.

I did exactly as I asked in my question: Instead of extending AbstractSingleFieldType I went for a more specific JIRA field implementation. Namely: The SelectCFType. By extending this class the field is indeed shown in the customer portal. There were some challenges though:

  1. There is currently no way of providing your own views / JavaScript code for loading in the select options via AJAX when someone begins to type their name in the select2 JavaScript input. The JIRA service desk renders the field like it would render the stock SelectCFType and does not use my views.

  2. The SelectCFType currently relies on Option(s) that are having a numeric (long) ID to identify each of them. This does not make sense in the LDAP world where the unique ID is the user distinguished name aka "DN". I did work around this by reading in all users from LDAP in a custom OptionsManager implementation on plugin startup and assigning a unique ID during that time.

  3. For displaying contact information inside an JIRA issue I did write my own Option implementation which has a getContact() method that returns my model for displaying the necessary information in the custom field view. This is also used for persisting the user ID (= user DN) as a value inside the database.

I hope this helps other people who were wondering about the same thing as I did.

I also have feedback for the Service Desk documentation regarding this issue: It just says "Other fields are unsupported" however from the context, it is not clear what is meant by "other fields". But maybe it's just me and my non-native English skills ;-)

Thanks again for getting back to me!

Lennart Rosam

amjad abdullah August 17, 2014

hi lennart,

do you have some kind of documentation about what you did here? because i want to try this.

Lennart Rosam August 17, 2014

Hi Amjad,

unfortunalty - no. However: JIRA Service Desk will include all of the basic Custom Field Types like SelectCFType NumberCFType or GenericTextCFType etc.. Extend your CF from any of these implementations and it will be included in the customer portal.

However, Service Desk will NOT include your custom views / javascript. For instance, if you implement your own custom field by extending the GenericTextCFType, Service Desk will not include your view, but the view that Service Desk provides for GenericTextCFs.

Depending on your use case, you may or may not be able to work arround these limitations by validating the input server side, throwing Exceptions and alike. But since Service Desk does not offically support third party custom fields, you are on thin ice here =/

Good luck,

Lennart

Sachin Dhamale October 30, 2014

hello Lennart Rosam; I have created custom field and successfully inserted on jira service desk but as you said it does not shown my GUI. Do you find any way to do this?

2 votes
ɹǝʞɐq pɐɹq
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2014

I am sorry to say Lennart that it is currently impossible to put "custom custom fields" into the Service Desk Portal.

One of the design aims of Service Desk was to "speak in the customers language and not the language of JIRA"

To achieve this we have a "re-rendering" of standard well know JIRA system and custom field types such as select lists, text fields, date time customer fields and so on. We have changed the labels, appearance

However we cant know how to "render" you specialised custom field inherently. And we have not as yet made this "portal rendering" pluggable. Not because we dont want people doing it but rather because ServiceDesk is still in the "startup phase" and this was deem less important than other work.

As time progresses we do understand that the call to allow "pluggable renderings" of custom fields will increase and that we will have to re-prioritize that decision. But in the short term we have no concrete plans to add this pluggability.

Brad Baker
JIRA Service Desk Architect

Jarosław Heba November 24, 2014

Hi @Brad Baker [Atlassian], Is there any issue for "pluggable renderings" which you had in mind, so I could follow it to see progress of that feature? Thanks in advance

Александр Верзаков
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.
May 4, 2017

Now is 2017. I couldn't find that "pluggable renderings"  :(

0 votes
Klaus-Jürgen Vagts January 20, 2014

Hi Brad,

thank you very much for your detailed explanation. I can see why this is currently not meant to be possible and I am looking forward to future releases. However, during the time it took to get this question out of the spam robot, I did actually manage to get my custom field to show up in the service desk customer portal.

I did exactly as I asked in my question: Instead of extending AbstractSingleFieldType I went for a more specific JIRA field implementation. Namely: The SelectCFType. By extending this class the field is indeed shown in the customer portal. There were some challenges though:

  1. There is currently no way of providing your own views / JavaScript code for loading in the select options via AJAX when someone begins to type their name in the select2 JavaScript input.

  2. The SelectCFType currently relies on Option(s) that are having a numeric (long) ID to identify each of them. This does not make sense in the LDAP world where the unique ID is the user distinguished name aka "DN". I did work around this by reading in all users from LDAP in a custom OptionsManager implementation on plugin startup and assigning a unique ID during that time.

  3. For displaying contact information inside an JIRA issue I did write my own Option implementation which has a getContact() method that returns my model for displaying the necessary information in the custom field view. This is also used for persisting the user ID (= user DN) as a value inside the database.

I hope this helps other people who were wondering about the same thing as I did.

I also have feedback for the Service Desk documentation regarding this issue: It just says "Other fields are unsupported" however from the context, it is not clear what is meant by "other fields". But maybe it's just me and my non-native English skills ;-)

Thanks again for getting back to me!

Lennart Rosam

Sachin Dhamale October 30, 2014

Hi Klaus-Jürgen Vagts; Do you find any way to add our own views / JavaScript code in programmatically created custom field which is need to use in help desk customer portal

Thanh Tu Nguyen August 15, 2016

hi, any update on this?

TAGS
AUG Leaders

Atlassian Community Events