Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to update a custom field with linked issue type status?

Bruno Xavier September 28, 2023

Please,

   I want to grab the linked issue status and show it on a specific custom field.

   How can I grab that information, and in addition, the "Assignee" field? 

 

Status.png

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 28, 2023

Hello @Bruno Xavier 

You can use an Automation Rule to get information from a linked issue and add it to custom fields in the issue to which it is linked.

Do you have any experience with Automation Rules? Here is the home page for the documentation:

https://support.atlassian.com/cloud-automation/docs/jira-cloud-automation/

Bruno Xavier September 29, 2023

Thank you Trudy
I am learning as my project requires, and it is new for me.

 

Let me check this link :)

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 29, 2023

This scenario is a little more complicated because you are working with linked issues. Are the issues in the same project? If not that adds another element that needs to be considered when creating the rule.

Don't hesitate to ask any questions that come up.

Bruno Xavier September 29, 2023

No that is not the same project.

I have been trying the entire morning with no success, which just makes the custom field "empty" let me paste here what I did

Issue.PNG

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 29, 2023

First thing - if the issue you want to update and the linked issue are not in the same project then you need to create a multiple-project rule. You have to do that from the Global Automation page. 

  1. Click the gear icon near your avatar
  2. Click System in the pop-up
  3. In the new screen from the navigation panel on the left click Global Automation.
  4. Click Create Rule
  5. Click on the Rule Details page.
  6. Change the Scope field to Multiple Projects
  7. In the Projects field select the projects that will have the issues you want to update and the linked issues.

Next - for testing purposes using a Manual Trigger is a good idea. Eventually I assume you want that changed to a trigger that will happen automatically, but we will start with the manual trigger. Additional steps and other changes to existing steps may need to happen when the change to an automated trigger is made.

So, let us assume for now that you are manually triggering this rule from the issue you want to update.

Next - we need to figure out which of its linked issues is the one we want to get data from. What is unique about the linked issue that can help us identify it?

  1. Is there only every one linked issue, or could there be multiple issues linked to the one you want to update?
  2. Do you use a unique link type to connect these issues? Could there be more than one linked issue that uses the same link type?
  3. Is the linked issue always in a specific project? Could there be more than one linked issue in that project?
  4. Is there some other identifier that is unique to the one linked issue you want?

Once we figure out what the criteria is for that one linked issue, we need to add a step to get the linked issue. The exact step is going to depend on the criteria we use.

The smart value you tried to use here is not a real smart value. Were you referencing some documentation or post that made you think it was?

Screenshot 2023-09-29 at 11.55.19 AM.png

Bruno Xavier September 29, 2023

Thank you, that is very helpful, so to answer those points:

  1. Is there only every one linked issue, or could there be multiple issues linked to the one you want to update?
    1. Can be multiple
  2. Do you use a unique link type to connect these issues? Could there be more than one linked issue that uses the same link type?
    1. One unique link type
  3. Is the linked issue always in a specific project? Could there be more than one linked issue in that project?
    1. More than one project
    2. Yes
  4. Is there some other identifier that is unique to the one linked issue you want?
    1. No but if that makes easy, I can edit to add a new field on those projects.
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 29, 2023

If I understand your answers correctly, when deciding on which linked issue you want to get the status from:

1. The issue will be linked using a unique link type,

-- Is that the "is blocked by" link, as shown in your image?

2. The linked issue could be any one of multiple projects,

-- In that case all the projects that might have either the issue you want updated or the linked issues need to be specified in the Rule Details > Scope. 

3. There could be more than one linked issue from that project

-- But could there be more than one linked issue from that project that uses the "unique link type"?

 

If there is more that one linked issue that might match the conditions then what do you do manually now to determine how to set the custom field value?

Bruno Xavier September 29, 2023

1. The issue will be linked using a unique link type,

-- Is that the "is blocked by" link, as shown in your image? yes

2. The linked issue could be any one of multiple projects,

-- In that case all the projects that might have either the issue you want updated or the linked issues need to be specified in the Rule Details > Scope. 

3. There could be more than one linked issue from that project

-- But could there be more than one linked issue from that project that uses the "unique link type"? not defined yet, if that makes easy I can do in that way

 

Thank you

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 29, 2023

3. There could be more than one linked issue from that project

-- But could there be more than one linked issue from that project that uses the "unique link type"? not defined yet, if that makes easy I can do in that way

What exactly are you trying to accomplish in this scenario?

You said you want to grab the Status of a linked issue and put it into a custom field.

If you want to consider more than one linked issue in this process then you must define what you would enter into the custom field based on having multiple linked issues with different status values.

If you want to base the update on one and only one linked issue then there must be a method to identify that linked one issue you want to use. It must have some combination of information that makes it unique. This could be some combination of

- the link type used (i.e. "is blocked by")

- the project in which the linked issue exists

- the issue type of the linked issue

- some other element of the linked issue that would distinguish it from other linked issues that match the other criteria

 

Knowing so far that you want only the linked issue(s) that use the "is blocked by" link, we can start by saying that you need to use the Lookup Issues action to get a list of all the linked issues that use the "is blocked by" link. The Lookup Issue action uses a JQL to retrieve issues.

From the Advanced Searching - JQL Functions page we know that we can use the linkedIssues() function.

  • Find issues that are linked to a particular issue via a particular type of link:
    issue in linkedIssues(ABC-123,"is duplicated by")

We can get the issue key for that statement using a smart value. {{issue}} references the issue in context at a given point in the rule and the issue in context may change as you progress through the rule. You can use {{triggerIssue}} to make sure that you reference the issue that caused the rule to be triggered. You add the field name that you want from that issue into the smart value. Double curly braces surround the smart value. You can find more information on available smart values here.

issue in linkedIssues({{triggerIssue.key}},"is blocked by")

Screenshot 2023-09-29 at 12.58.11 PM.png

 

The result set from the JQL will be stored in a special list smart value named {{lookupIssues}}

If there is a scenario where there might be multiple issues in the result set, and you only want to consider one of those issues, then we need another criteria we can add to the JQL to zero in on that one issue.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events