JIRA automation: how to extract project start/end of JIRA product discovery to a custom field?

Amy Hu
Contributor
July 19, 2023

Update question summary and details based on @Hannes Obweger - JXL for Jira suggestion~

How could I extract the start and end date using JIRA automation and write it to a date-based custom field?

 

 

---------

JIRA prompts "Field 'Project start' is not searchable, it is only sortable." for the default field "Project start" in JIRA product discovery. What I want to do is to create JIRA automation to sync the dates and components/categories between JIRA software and JIRA product discovery.

I can't even find this field in custom fields, but it does have id "cf[xxxxxx]".

Anyone knows the root cause and the possible solution/workaround? Thanks.

2 answers

2 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
July 20, 2023

Hi @Amy Hu

the project start field is a relatively new field, and it looks like this aspect hasn't been implemented yet. It may be worth raising this with Atlassian; e.g. there's a "Give feedback" option in the JPD project sidebar.

As a workaround, I can think of two things:

First, as the "project start" field is stored internally in the format

"{\"start\":\"2023-07-01\",\"end\":\"2023-09-30\"}"

you may be able to extract the start and/or end date using Jira Automation and write it to a date-based custom field. You can then filter based on this custom field. I'm not a big Automation expert, so I can't really advice on how to write such a rule, but perhaps someone else can lean in.

Second, if you're open to solutions from the Atlassian Marketplace, you may want to have a look at the app that my team and I are working on, JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It fully supports the project start field (and many other JPD fields), meaning that you can easily filter your issues like e.g. so:

jpd-search-by-project-start.gif

Once you've narrowed down your list of issues, you can work on your issues directly in JXL, trigger various operations in Jira, or export your issues with just one click. (Note that JXL can do much more than that: From support for configurable issue hierarchies, to issue grouping by any issue field(s), sum-ups, or conditional formatting.)

Any questions just let me know,

Best,

Hannes

Amy Hu
Contributor
July 26, 2023

Hi @Hannes Obweger - JXL for Jira 

Appreciate! Option 1 looks feasible to us at this moment.

I've changed the question summary and details a bit to seek for help from others. :)

Amy

0 votes
Joel G November 10, 2023

I know there is a general answer above, but since I had to work through this, I thought I'd share my process and answer:

  1. First identify all the field names that you need to use:
    1. https://[JIRA_BASE_URL]/rest/api/2/issue/[ISSUE-KEY]?expand=names     
      1. See: https://confluence.atlassian.com/jirakb/how-to-find-any-custom-field-s-ids-744522503.html
    2. I wanted to sync the Project Start to Start Date and Project Target to Due date
    3. Make small changes to a test issue in the fields you want to use. Refresh the above URL.  Use a tool to see the differences easily (it is usually easier to format and then use a comparison tool)
  2. Write an automation rule on the Discovery Project
    1. When: Trigger off the change of Project Start or Project Target changing
    2. Then: Use the Additional fields section of the Edit Issue Activity, using the match function, to get the Project start and Project target from Discovery and set their corresponding Start Date and Due Date fields:
      1. Discovery has a field that looks like this: {"start":"2023-03-31","end":"2023-03-31"}
      2. Match the start by first matching the start and then creating a group around the actual start date: match(".*start.*([0-9]{4}-[0-9]+-[0-9]+)")     
      3. Match the end using a similar plan: match(".*end.*([0-9]{4}-[0-9]+-[0-9]+)")     
      4. Resulting “Additional Fields”:
{
    "fields": {
        "customfield_13462": "{{issue.customfield_13683.match(".*start.*([0-9]{4}-[0-9]+-[0-9]+)")}}",
        "duedate":"{{issue.customfield_13684.match(".*end.*([0-9]{4}-[0-9]+-[0-9]+)")}}"
    }
}

 

Additional Notes: Use the Log action if you run into any trouble with the matching. For example:

Target Date: {{issue.customfield_13684.match(".*end.*([0-9]{4}-[0-9]+-[0-9]+)")}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events