Forums

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

How to link service requests created during automation?

darrellb May 8, 2023

We have a workflow wherein a primary form is created which will create subsequent service requests for tracking and auditing purposes. I've gotten the creation / management down, but I can't quite figure out how to establish links for the issues. 

The automations only allow me to select software projects for linking operations, and the fields documentation doesn't work for service. Just returns:

"Unknown fields set during create, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored -
Linked Issues (issuelinks)"
What is the fields reference for links in service, or is this just not doable currently?

2 answers

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
May 8, 2023

Are you trying to create issue links as part of a Create Issue action?

Have you considered using the Link Issue action instead, after the Create Issue action?

Can you show us your complete automation rule and the details of the step where you are trying to add links?

Can you show us the rule Audit Log showing the messages that are logged when the rule executes?

Can you provide more information about the following statement? What exactly are you trying to do? Maybe a screen image would be helpful.

The automations only allow me to select software projects for linking operations, 

darrellb May 8, 2023

This is in the Create Service Request action (Service Desk), not Create An Issue (Software). I have indeed tried the link issue action within the automation, but in the Service Requests that get created, there is no established links setup on the requests after creation

darrellb May 8, 2023

automation.png

 

Below is an example of the audit log. It just shows the successful phases for the request creation, but not specifically anything about the linking

created.png

Trudy Claspill
Community Champion
May 8, 2023

Your Link Issue action, based on its position, is in the context of the trigger issue, not the newly created issue. The net effect is it is trying to link the trigger issue to itself.

 

If you want to link the newly created issue to the trigger issue then:

1. Add a Re-fetch Issue step after creating the new issue.

2. Set your Link Issue action thus (selecting the appropriate link type):

Screen Shot 2023-05-08 at 2.20.32 PM.png

Like Esther Strom likes this
darrellb May 8, 2023

Oh that got it for me! Thanks! I'm relatively new to automations so I wasn't even aware fetching was an action!

Like Trudy Claspill likes this
Esther Strom
Community Champion
May 8, 2023

Yup, @Trudy Claspill got there first; I had to go back to my sandbox and prove that linking in JSM works. But my next comment was going to be about issue context! 

FYI, if you were to use the JSON to do the linking instead of the link issues action, you should be able to use {{issue.key}} as the inward issue link in the Create Issue action.

ruleSetup.png

Like Trudy Claspill likes this
0 votes
Esther Strom
Community Champion
May 8, 2023

Hi, @darrellb - how are you trying to link your tickets in your automation? Via the Link Issues action? You may not be able to do it that way, but you should be able to via the More Options JSON field at the bottom of most actions. 

It would look something like this:

{
"update": {
"issuelinks": [
{
"add": {
"type": {
"name": "Problem/Incident"
},
"inwardIssue": {
"key": "{{issue.key}}"
}
},
"add": {
"type": {
"name": "Problem/Incident"
},
"inwardIssue": {
"key": "{{triggerIssue.key}}"
}
}
}
]
}
}
darrellb May 8, 2023

I tried that but received the error listed in the original statement:

 

"Unknown fields set during create, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored -
Linked Issues (issuelinks)"
issueLinks doesn't appear to be part of a ServiceRequest object like it is a Jira issue
darrellb May 8, 2023

I'll give it a shot though and see if maybe this one is different than the one in the docs!

Esther Strom
Community Champion
May 8, 2023

You can definitely link tickets to a JSM ticket; we do it all the time both manually and via automation JSON. 

Is it possible you don't have Linked Issues available in your JSM field configuration or on the screen?

Esther Strom
Community Champion
May 8, 2023

Just to clarify, if you try my example you'll need to update "Problem/Incident" to match one of your system's valid issue link types. 

darrellb May 8, 2023

Same problem. Audit log fails that:

issueLinks.png

darrellb May 8, 2023

Yeah the issue isn't the Type, it's that the issueLinks key doesn't seem to exist in the service request as pictured above

darrellb May 8, 2023

"Is it possible you don't have Linked Issues available in your JSM field configuration or on the screen?"

 

We definitely have them enabled. I can manually link via the UI without any issue

darrellb May 8, 2023

links_are_there.png

As a point of reference. I can manually create links in the JSM UI and see them. They're just not appearing via the link automations. 

Suggest an answer

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

Atlassian Community Events