Custom configuration values in the JIRA server

Hi

I'm writing a JIRA integration in my client application. My application is able to list and show Jira issues, and we also have setup a custom field to include custom info in the issues.

Now, I want to include some custom information in the custom field. That information is an URL, but the URL must be defined by the JIRA administrator. So, I need the following:

1) I need the JIRA administrator to configure a "variable" in JIRA server. For example: http://myurl/view/$id$

2) Then, I need the client to read that URL value, then replace the variable fields with a valid id, and will write it in the custom field. For example, if we're processing the item 54, the URL that will be posted to the custom field will be http://myurl/view/54

My questions are:

1) Where should the administrator store the URL?. I tried the application properties, in the jira-config.properties file but the problem is that I need a WebSudo to get the properties. An starndard client normally uses a non-admin account

2) What API call should the client use to retrieve this configuration value?

Thanks in advance

3 answers

1 accepted

This widget could not be displayed.

This is what I was looking for:

jira.websudo.is.disabled = true
jira.property.test = http://myurl/view/$id$

This widget could not be displayed.

This new url is not as simple as just adding a variable - you'll need to create a plugin that adds the variable url, allows the administrator to configure whatever it is, and then provides the url to non-admin accounts. You'll also need to write all the API segments to expose it internally.

I suspect you might be best off with a more simple approach - write a scripted custom field that gets and displays the data. Your admin can set the url in the script they write, and as it's displayed directly on screen, anyone who can see the issue can fetch it (even REST lets you grab custom field data)

Hi Nic, thanks for your answer, please, could you provide a simple example of an scripted custom field, or refer to some documentation, so I can understand exactly how to proceed? Thanks!

Tarun Sapra Community Champion Feb 24, 2014

Scripted custom field is part of script runner plugin https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+Fields

This widget could not be displayed.

It can be done with the help of katl-commons plugin, see section http://confluence.kepler-rominfo.com/display/SIL/KRedi+-+The+Redirect+Assistant

Your URL will be in the form: <base_url>/secure/KRedi.jspa?key=TST-1234&urlid=9876

and your script:

number ikey = argv["key"];
number lid = argv["urlid"];

//replace with your own customfield id
%ikey%.customfield_12345 = "http://foo.com/my/path/" + lid;

//the return below doesn't matter
return "/browse/" + ikey;

Katl-commons is free and it can be used to do all these sort of integrations.


Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

134 views 2 0
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you