Select Pro

Inspiration

The project is a forge app for Atlassian Jira Cloud, based on similar functionality found in ScriptRunner for Jira DC (of which I am the founder).

What it Does

The app allows you to create a Jira custom field that lets the end user select from a linked resource. That resource could be a table or view in a database, from an LDAP query, or from an arbitrary REST API. It also has issue pickers.

The advantage of these pickers is they allow programmatic control of many aspects of the field, for example what to search on, what to display in the dropdown, and how to render the field when shown an issue.

How We Built It

In each case, there is a simple TypeScript interface to implement. For instance, in the case of Supabase, you will specify your project ID, API token, and table or view name, and the columns you want to use for a) the permanent id and b) the value to search on and display. If you want to customize any of these aspects, you can write a little bit of code.

Challenges We Ran Into

Because we allow the user to run JavaScript code, this created some major changes. The Forge function can be reused (a warm start) between different clients. Therefore, we need to prevent the end user from persisting changes to prototypes, or writing anything to disk that may be reused in a later invocation. If we're not careful here, it's possible that an attacker can run code that can exploit whatever permissions the app has, on another customer instance.

Other challenges come via the differences in architecture between DC and Cloud. If you blindly reimplement everything in cloud same as in DC you will have a slow product. Instead, care needs to be taken due to the effect of latency when making REST requests.

Accomplishments That We're Proud Of

We've implemented a comprehensive REST version with various base options:

  • Pick from Supabase table/view
  • Pick from Airtable table/view
  • Pick from SeaTable table/view
  • Pick from public or private Google sheet
  • Pick from arbitrary REST API, eg restcountries.com, or github.com etc etc
  • Pick from Jira REST API, eg select from components across multiple projects, or components with a particular lead

What We Learned

The importance of careful security considerations when allowing custom code execution in a multi-tenant cloud environment, and the critical need to optimize for cloud architecture differences.

What's Next for Select Pro

Addressing current limitations:

  • Developing a workaround for database picker (currently not possible due to Forge's TCP connection restrictions)
  • Expanding REST API integration options
  • Continuing to refine security and performance

Example Use Case

Consider a field that allows you to pick a "customer" from your CRM… the dropdown might show the customer name and company, with a search on customer surname. When viewing the issue it may display additional data, for example the dollar value of contracts associated with them.

The issue picker is similar to Jira issue links, but is configured with a JQL query to govern the list of valid issues for selection. So, you might restrict to the Bug issue type for a field "Root Cause". What makes this interesting is that the JQL can be generated via code, for instance, you can check the end user's role within the current project, and return different JQL accordingly.

Built With

Share this project:

Updates