Auto-populate a custom field with issues containing the keyword typed in summary while creating an issue

Pratima Gorla
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.
December 13, 2013

Hello,

I'm trying to auto-populate a custom field with all issues containing the keyword typed in summary while creating an issue.

I also want to populate the same custom field with the wiki pages related to the keyword typed in summary. I'm using JIRA 4.4.5

I'm attaching screenshot of what I'm trying to achieve to have better understanding.

Issues displayed in customfield should be hyperlinks (to the issues).

I'm trying to implement this using Ajax, all I could figure out is modify the customfield based on summary. Please sugguest me.

Thanks,

Pratima

6 answers

1 accepted

1 vote
Answer accepted
Pratima Gorla
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.
February 25, 2014

Hello,

This issue is fixed. I used Javascript+ REST API in Jira 6.1.2 to fix it. I'm sharing result if anyone is interested. :)

I created a 'Message customfield(edit)' with Default value as a html code to create gray box.

Used following script in description to display results:

<script type="text/javascript">
(function($){
$(document).ready(function() {
var summary = document.getElementById('summary');
 resultDisplay(summary.value);
 summary.onchange = function() {
  resultDisplay(summary.value);
 }; 
 });

function resultDisplay (sVal) { 
if(sVal !="") {
    var val= getQueryVal (sVal);
  document.getElementById('customfield_10100').innerHTML= val; 
  
 }
}
function getQueryVal(sVal) {
 var issuesList="";
     AJS.$.ajax({
        url: "/jira/rest/api/2/search?jql=summary~\""+encodeURIComponent(sVal)+"\"",
        type: 'get',
        dataType: 'json',
        async: false,
        success: function(data) {
            var size= data.total;
            for(var i=0; i<size;i++) {
               issuesList += "<a href=\"/jira/browse/"+data.issues[i].key+"\">"+data.issues[i].key+"</a>  "+data.issues[i].fields.summary +"<br>";
            }
        } 
     });
     return issuesList;
}
})(AJS.$);

</script>

I guess we can use REST API for Wiki to display results similarly (I havn't tried it).

Thanks!

0 votes
Pratima Gorla
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.
December 19, 2013

Speakeasy, JSONP looks promissing, yet I'm still trying to figure out!! :(

0 votes
Royce Wong
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.
December 17, 2013

I swear I have seen an article implementing auto. suggest in JIRA's summary field (using perhaps ajax, css, xml). It just bugs me that I can't locate that article... argh.

0 votes
Aseem Parikh
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.
December 16, 2013

I think SuggestiMate is the plugin Royce is thinking of: https://marketplace.atlassian.com/plugins/com.suggestimate

If you want to implement it yourself, you might want to check out the Speakeasy plugin. You'll have to upgrade JIRA to at least 5.1.8 in order to use it, however.

0 votes
Pratima Gorla
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.
December 16, 2013

Thank you Royce. I couldn't find it either.

Hope someone might have come across this sort of scenario.

0 votes
Royce Wong
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.
December 15, 2013

I remember reading an article (perhaps from Atlassian's Developer Blog) that does just that. I tried googling it but couldn't find it, perhpas others on ths forum have better luck.

Suggest an answer

Log in or Sign up to answer