Forums

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

Tips & Tricks with JSM - CustomField for Site Spaces (Projects)

Robert Nadon
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.
November 10, 2025

 

Big thanks to Sarah Wright, Paulo Ramalho, Harrison Ponce, and Darryl Lee for sharing your ingenious perspective and wisdom. folded hands folded hands folded hands folded hands

Do you admin Jira and Confluence for your team/company? I do, and as part of my workflow, I use dynamic forms in JSM, letting users fill out key details for each tool.

But I recently hit a snag: When creating a Jira issue, my form asks whether it’s a request for a new project/space or an issue with an existing one. For new requests, the form pulls up dynamic fields for items like “Space Name,” “KEY,” and “Space owner/lead”—all good so far. But for requests about existing projects, I wanted to display a select list containing all the Jira spaces in the site.

Wait a minute!!! Jira does not have a select list field that contains all the Jira spaces in the site.


First Solution

My first try was to go back to my article on populating large select list. Dump the set of spaces to a CSV file and create a multi-select list from it—that works, I’m good, until someone wants a new Jira space. I will have to remember everytime I create a new space to go to the custom field and manually update it. nauseated face


Second Solution

Surely someone’s run into this before, right? I did some Googling but didn’t find much. So next, I reached out to the Champions. The first suggestion came from my colleague in Oslo, Paulo Ramalho:

“I import all the projects as assets via a custom Python script twice a day and use the assets field in the form.”

Given the pace of new project creation here, even running that weekly would probably be fine. I’m familiar with Assets and Python is my go-to language, so this approach is definitely feasible — and far better than manually updating the field.

That said, it would mean maintaining a separate server to run the Python code. I could do that, but I’d rather not if I can avoid it.


Third Solution

The Champions channel is fantastic—more solutions kept coming in! Harrison Ponce had a good solution. Instead of Python, use Automation.

“We have an automation that creates asset objects on project creation, and uses smart values to store attributes/naming like project title, project type, owner, etc. Then we use those in an assets custom field with a specific context and AQL filter for our request forms on Atlassian support internally.”

Sticking with Automation keeps everything within Jira, which I really like. I started setting this up when, just as I was getting started, another solution was suggested…


Final Solution

This last one was so slick and easy the I said I have to add this to my JSM Tips and Tricks!

Sarah Wright then said,

“… data connections for forms. Add or unlink a data connection from a form | Jira Service Management Cloud | Atlassian Support Could this be helpful to avoid using assets?”

party popper party popper party popper

I truly appreciated all responses but this last one worked fantastic and I am using it today. Thank you Sarah!


Implementation

How is it done?

  1. Create an API token/key for authentication purposes, if you do not have one handy.

  2. Create the data connection

    • Go to your sites data connections. To get there, I type “.” then data connections and get right to it.

    • Click: Add Connection

    • Fill out Name (Call it whatever you like, I chose Jira Projects)

    • URL: https://yoursitehere.atlassian.net/rest/api/3/project?field=name

    • Authentication: Basic

    • Username: The Email that you created the API token with

    • Password: The API token

    • Cache results: Up to you, I choose 1 day, as we do not create spaces that often.

    • Click [Next]

    • Make sure the Response has data.  If not it is most likely an authentication issue with the API token you used above.

    • Click [Next]

    • Items: /

    • ID: id (you could also use key here)

    • Label: Name

      selection.png
    • Click [Next]

    • Finally, Click [Save]

  3. We now have a Data connection, lets go to the form

    1. Select Add-field in the area you want the select list to appear. I chose a multiselect dropdown field. (To use a data connection on a form field, the form field needs to be a multiple choice, dropdown, or radio field.)

    2. Display Name: Again call it what you like, I chose Jira Space (Project)

    3. Below Linked Jira Field, select the Data Connection you just created.

      form.png

BOOM! Everything is there. Now when they select “Issue with existing Jira space“ it shows my new field Jira Space star-struck populated with all the spaces.

Here is what it looks like on the Portal:

portal.png 

Warning: Using the REST API could have limitation of only showing the first 50 spaces. Darryl Lee (SJ) let me know that,

“it does not max at 50, BUT is deprecated. I bring up pagination because in 2018 Atlassian announced they wouldn't be stopping support of the Jira API endpoint that gives you ALL Projects with one single API call, which enables your data connection to work.”

Fortuneately, we will not hit that limit for a while. But instead of pagination, you can limit it by using space catagories and asking for the catagory first, then only fetch the spaces in that category. This approach is similar to how I have two separate data connections for confluence, one for personal spaces and another for communal.

 

Within the URL you can limit what is returned and the amount of items returned.

Here are my two Confluence URLS:

Communal: https://xxxxxxx.atlassian.net/wiki/rest/api/space?type=global&limit=200

Personal: https://xxxxxx.atlassian.net/wiki/rest/api/space?type=personal&limit=200

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events