Automation rule | Store linked issue in a custom field text on Issue
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
This KB article will help in sharing the suggestions for the use case :
When an issue gets linked with any issue relation, let's say "Blocks" then store the issue key in the custom field "Text" type on the Parent issue.
Solution
Automation rules can be setup with different approaches for this use case. Here is one approach that you can explore:
Trigger: Issue linked Branch rule / related issues: Type of related issues: Current Issue Lookup issues: JQL: issue in linkedIssues({{key}}, "blocks") Edit issue: Select the desired custom field. Pass the value in the field: {{lookupIssues}}
Here is the automation rule configuration file for reference:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
"cloud": true,
"rules": [
{
"id": 15126453,
"clientKey": "fcb18f79-08d6-35bd-9c47-b1e204f45645",
"name": "Add linked issue in the custom field",
"state": "ENABLED",
"description": "",
"authorAccountId": "6362284b01c2ff842c19db70",
"actor": {
"type": "ACCOUNT_ID",
"value": "557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"
},
"created": 1696235484668,
"updated": 1696236596349,
"trigger": {
"id": "329691080",
"component": "TRIGGER",
"parentId": null,
"conditionParentId": null,
"schemaVersion": 1,
"type": "jira.issue.event.trigger:link",
"value": {
"linkTypes": [
"Blocks"
]
},
"children": [],
"conditions": [],
"connectionId": null
},
"components": [
{
"id": "329691082",
"component": "BRANCH",
"parentId": null,
"conditionParentId": null,
"schemaVersion": 1,
"type": "jira.issue.related",
"value": {
"relatedType": "current",
"jql": "",
"linkTypes": [],
"onlyUpdatedIssues": false,
"similarityLimit": 40,
"compareValue": 0
},
"children": [
{
"id": "329691084",
"component": "ACTION",
"parentId": "329691082",
"conditionParentId": null,
"schemaVersion": 1,
"type": "jira.lookup.issues",
"value": {
"id": "_customsmartvalue_id_1696236456463",
"name": {
"type": "FREE",
"value": "lookupIssues"
},
"type": "JQL",
"query": {
"type": "SMART",
"value": "issue in linkedIssues({{key}}, \"blocks\")"
},
"lazy": false
},
"children": [],
"conditions": [],
"connectionId": null
},
{
"id": "329691085",
"component": "ACTION",
"parentId": "329691082",
"conditionParentId": null,
"schemaVersion": 1,
"type": "codebarrel.action.log",
"value": "{{lookupIssues}}",
"children": [],
"conditions": [],
"connectionId": null
},
{
"id": "329691086",
"component": "ACTION",
"parentId": "329691082",
"conditionParentId": null,
"schemaVersion": 10,
"type": "jira.issue.edit",
"value": {
"operations": [
{
"field": {
"type": "NAME",
"value": "Link Key"
},
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:textarea",
"type": "SET",
"value": "{{lookupIssues}}"
}
],
"advancedFields": null,
"sendNotifications": true
},
"children": [],
"conditions": [],
"connectionId": null
}
],
"conditions": [],
"connectionId": null
}
],
"canOtherRuleTrigger": false,
"notifyOnError": "FIRSTERROR",
"projects": [],
"labels": [],
"tags": [
{
"id": 44621159,
"tagType": "IS_RULE_UPDATED",
"tagValue": "true"
}
],
"ruleScope": {
"resources": [
"ari:cloud:jira:7bbd0f61-9cf7-46a8-a02c-5d635b174db8:project/10015"
]
},
"ruleHome": {
"ruleLifeCycleHome": {
"locationARI": "ari:cloud:jira:7bbd0f61-9cf7-46a8-a02c-5d635b174db8:project/10015"
},
"ruleBillingHome": {
"locationARI": "ari:cloud:jira-software::site/7bbd0f61-9cf7-46a8-a02c-5d635b174db8"
}
},
"writeAccessType": "UNRESTRICTED",
"collaborators": [],
"billingType": "NORMAL"
}
]
}
INFORMATION
If you want to the issues in the hyperlink format then ensure that the custom field has setup Wiki Style renderer as an Active renderer for the field. You can check the KB article: How to update Active Renderer for the field to setup Active Renderer as Wiki Style.
Was this helpful?