Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Custom Field plugin same as an Issue Links System field

Nadhir Hajji March 16, 2022

I want to Create a plugin custom field to reference similar issues to help developers in my company ('not a linked issue'). the issue references are already generated by a machine learning NLP module based on issue summary, description, and comments.
It will be perfect to show the results in the same way as the system field 'issue links'
Can I create a field same as the 'issue links' system field

note: my company is using Jira Software 7.12.1

1 answer

1 vote
Nic Brough -Adaptavist-
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.
March 16, 2022

Welcome to the Atlassian Community!

Issue links in Jira are not just a custom field, they're a whole pile of stuff that's been coded for as a core part of the system - a display tab, a data structure (that's not the same as custom fields), JQL functions, and and and.

You've got quite a lot of work to do to create something like that, and it won't work the same as the system links.

I would be tempted to just use issue links, so it'll fit in automatically (and you don't have to write vast swathes of code to replicate a function)

Nadhir Hajji March 17, 2022

Hello Nic, thanks for the warm welcome.

your answer was inspiring, the idea of using the issue link field to display my output, I can create a new issue link type that serves my objectives but can I make it displays automatically always in all issues whenever the user adds the link issue field or not? 

Nic Brough -Adaptavist-
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.
March 17, 2022

Re-using the existing issue link functionality is going to be a lot easier!

Yes, I would suggest creating one or more link types for your module to use.

I am imagining your module would do something like:

  • Spot that a new issue has been created (or a significant edit on fields it is interested in has been made)
  • Go have a look for stuff that might be linked
  • Add a link (of the dedicated type) to the new/edited issue over to any other issues the module finds

If that's the basic iintention, then yes, the links will appear automatically in the issues, the users do not have to do anything with the links themselves

Caveats though - 1. there's no autorefresh, the links will become visible the next time the issue is displayed/refreshed, not instantly when a user has an issue open.  2.  Links will only appear if the user can see both ends of the link - no point in showing a link to an issue the user can't see!

Nadhir Hajji March 17, 2022

All great for now!

I need to figure out how to give the links I provide to the issue links field so he can do his work and show it, but how I can do that? is there any specific module or class I can use ? or any kind of solution to communicate with the issue links field? 

Nic Brough -Adaptavist-
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.
March 17, 2022

Exactly how you do it is dependent on how you are coding to do it.

I need to re-state that issue links are not a "field", they're a system function and you don't interact with them in the same way that you do with fields.

If you were wanting to create a new link between two issues using Scriptrunner, the example I go back to is https://library.adaptavist.com/entity/add-or-update-the-issue-link-for-an-issue-in-jira

That code is a) running inside Jira, b) run in SR's "console" and c) written in Groovy.   In this case, the Groovy is just making the java a bit easier; the bits after all the "def =" bits are the java I would be using if I were writing a server app for Jira. 

Suggest an answer

Log in or Sign up to answer