Forums

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

Automation from a Value Change in JSP to Edit related field in it's linked issue in JDP

Selena Peri June 28, 2024

Kia Ora,

Working on setting up Automation rule between two projects (one is JDP and the other is JSP).
I have successfully setup a automation rule from a value change in JDP to then edit linked issues (e.g., relates to) corresponding field.

However, when I try to setup a automation rule going the other way (value change in JSP to then edit linked issues (e.g., relate to) in JDP the rule fails,

I have create the automation rule as follows (from value change in JSP to edit related field in it's linked issues (e.g., in JDP):
Screenshot 2024-06-29 090233.png
I have also typed in the box below Business Value Outcome: {{triggerIssue.customfield_10504}}

I have research round and round but can't get the field working... my audit lot is:
Screenshot 2024-06-29 090040-.png

When I go to Jira Setting -> Custom Fields... I'm unable to see "any of the JDP" fields in this view.

TIA for any support.

1 answer

0 votes
Bill Sheboy
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.
June 28, 2024

Hi @Selena Peri 

First thing, I note Edit Issue action appears to have the "Business Value Outcome" field selected from the dropdown list and updated using JSON (using its custom field id).  Only one of those methods may be used for a specific field at a time in a single edit.  Please try removing the JSON and pasting the smart value expression into the field edit:

{{triggerIssue.customfield_10504}}

 

Next, what type of field is customfield_10504: text, single-select option, multiple-select option, etc.?  The type of field may impact how to perform the edit of the JPD field.

Same thing for the JPD custom field, "Business Value Outcome".

 

Finally, issue linking is often directional, especially for JPD <-> JSP (Jira Software Project).  But your branch is checking link types which are in both JPD and JSP issues.

If you want the branch to select the JPD idea for the JSP trigger issue, please change the branch to only check "implements".

 

Kind regards,
Bill

Selena Peri June 28, 2024

Kia ora Bill,

Thanks for your reply!

You are correct I had been testing using JSON code (as I was trying all various ways...)... when trying on way I didn't have JSON code in there and it was only {{triggerIssue.customefield_10504).

Customfield_10504, a JSP field, is setup as field type: radio button. The linked issue field, in JDP (the field to be edited), is field type: multi-select (customfield_10565).

Still no luck as  per screenshots (updated rule and audit log outcome after retrying):Screenshot 2024-06-29 102830.png
Screenshot 2024-06-29 102325.png

Selena Peri June 28, 2024

One thing that is interesting is that in Jira Setting > Custom Fields, I'm unable to see any JDP custom fields. Is this normal? Through research it seems one should be able to see all "custom fields" in Jira Settings...

I have admin rights in both projects that I'm working with too.

S

Bill Sheboy
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.
June 28, 2024

Thank you for that information!

 

As the JSP field customfield_10138 is a radio button, it will return the text of the selected option with either of these:

{{issue.customfield_10138}} or {{issue.customfield_10138.value}}

Does your JPD custom field customfield_10565 have exactly the same options as the JSP one?  If not, setting the field cannot work.

If they match, you may set the value as I described earlier:

  • select the JPD field in the dropdown list
  • enter the smart value expression {{issue.customfield_10138}}
  • when the value appears below the field, select it for use in the edit

I just tested this and it does work for a JPD, multiple-select custom field.

Bill Sheboy
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.
June 28, 2024

For your question about custom field visibility in the admin functions...

JPD appears to be built upon the same technology as team-managed projects (TMP) and so their custom field configuration is distinct for each project and does not appear in the global settings. 

 

As an aside...

This behavior sometimes causes confusion when writing JQL (or using dashboards) that span multiple CMP or TMP projects.  For example, a field with the same name can have different, possible selection values...or even types!  The workaround is to use the custom field ID in the queries for JQL, although there are limited workarounds for the built-in, dashboard gadgets.

This symptom has been improved recently for TMP by allowing the use of global context, custom fields in those projects.  However, that is not yet possible for JPD projects.

Like Selena Peri likes this
Selena Peri June 28, 2024

Kia Ora,

Again - thank you for further support.

OK so in the EDIT section I update the Smart Value to: {{issue.customfield_10504}} or {{issue.customfield_10504.value}}... customfield_10504 is the JSP field that I'm changing... and want that change made to customfield_10565.
Screenshot 2024-06-29 113305.png

I'll try above however, sorry, this part - besides bullet point #2 am I making possible another changes to my rule?

  • select the JPD field in the dropdown list
  • enter the smart value expression {{issue.customfield_10138}}
  • when the value appears below the field, select it for use in the edit
Selena Peri June 28, 2024

Update:
Still no luck at my end...

EDIT section updated as follows:
Screenshot 2024-06-29 114614.png

and audit log is same as others:
Screenshot 2024-06-29 114511.png

in my FIELD VALUE CHANGE: is this configured to say when my JSP customfield_10504 is changed...

Bill Sheboy
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.
June 29, 2024

It appears someone linked together two JPD ideas with the "implements" link type: PORT-37 and PORT-300.

Thus PORT-300 is also found by the branch, and JPD ideas do not have the JSP field, Business Value Outcome, leading to the rule error.

Ways to address this are...

  • As the "implements" and "is implemented by" links are usually only for JPD <-> other projects, consider removing that link to PORT-300
  • Or...inside the branch and before the Edit Issues action, add a condition to confirm the issue is not in the PORT project:
    • Issue Fields Condition:
      • field: Project
      • condition: does not equal
      • value: PORT (your portfolio project)

 

Selena Peri June 29, 2024

Kia Ora,

hmm -> ok, still not luck... I removed linked issue PORT-300 and I get the following error log:
Screenshot 2024-06-30 101735.png

I tried on another JSP issue... changed PORT_Business Value Outcome (10504)... and the linked issue (relates to) to change JDP field: Business Value Outcome (10565) -> same error log:
Screenshot 2024-06-30 101854.png

 

This is how my rule is configured:
WHEN
Screenshot 2024-06-30 102032.png
THEN
Screenshot 2024-06-30 102200.png

BRANCH
Screenshot 2024-06-30 102236.png
Screenshot 2024-06-30 102323.png

Honestly - thanks for looking in to this - just very confused why it's not working... it seems in the Audit log that on the impacted issue (one where the value is to be edited) is doesn't recognise customfied_10565

TIA!

Bill Sheboy
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.
June 29, 2024

Which project is JPD and which is JSP?  Knowing that will confirm if the triggers and link directions are correct.

Why did you change the branch on linking from "implements" to "relates to"?

Selena Peri June 29, 2024

Kia ora Bill,

 

JDP is the issue that is to be edited (Business Value Outcome: customfield_10565) - company managed project.
JSP is the trigger issue (PORT_Business Value Outcome: customfield_10504

I removed "implements" and changed to "relates to" -> because the issue to be 'edited' was a linked issue by "relates to" connection.

I didn't realise I had that branch config wrong... when I had PORT-300 linked that was by "implements".

TIA

Bill Sheboy
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.
July 1, 2024

Short version: it appears your scenario has uncovered an apparent defect in automation rules with JPD idea / issue edits and multiple-project scope rules.  There are known limitations with JPD and automation rules, but this one is not listed.

I recommend working with your Jira Site Admin to submit a defect here to learn what they suggest: https://support.atlassian.com/contact/#/  I recommend including a link to this community question so the support team can observe what was tried.  When you hear back from them on a solution, please post what you learn to benefit the community.  Thanks!

 

I do see an error in the last images you posted, where the edit issue action uses the incorrect custom field id, but that does not impact the apparent defect.

 

To summarize the scenario in GIVEN-WHEN-THEN format:

GIVEN an issue in the Jira Product Discovery project, named PO
AND an issue in the Jira Software Project, named PORT
AND the PORT issue implements the PO issue using the built-in JPD delivery linking
WHEN the PORT issue's Radio type, custom field PORT_Business Value Outcome (customfield_10504) changes
THEN update the PO issue's multiple-select, custom field Business Value Outcome (customfield_10565) to the same value from the PORT issue's field (customfield_10504)

 

That leads to this rule, with all extra steps removed:

  • rule configured for multiple-project scope of one JPD and one JSP company-managed project
  • trigger: issue field changed for the Radio type custom field in the JSP project
  • branch: linked issues of type "implements"
    • action: edit issue, setting the JPD multiple select custom field to {{triggerIssue.customfield_10504}}

 

I implemented the rule we have been trying to fix, and here is what I observed:

  • the rule finishes successfully, indicating the field was edited, but it does not actually change the JPD idea field
  • I tried both branch types to access the JPD idea: by links and by JQL
  • I tried both edit issue field types: by field selection and with JSON
    • The only workaround I did not try was using the Send Web Request action to edit the JPD idea's field from the rule.  This may have confirmed if the cause is related to the rule action or the REST API for updating the issue.
  • adding writes to the audit log to check the field before the edit does not always return a value for the JPD idea field
  • adding writes to the audit log to check the field after the edit always indicates the edit worked!
  • creating a different test rule, limited in scope to only the JPD project, always works correctly to edit the field, so my hypothesis is the cause is a scope problem between JPD and non-JPD issues for this type of field edit

 

Please post what you learn from the support team.

Suggest an answer

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

Atlassian Community Events