Hey, guys!
Is it possible to hide or prevent editing "Epic Link" column when editing issue, but allow to set "Epic Link" when creating issue? This rule should be applied just for issues which have "Epic Link".
I have a chance to use ScriptRunner.
Hello @zaharovvv_suek_ru
You can use ScriptRunner Behaviours for this
Add-ons -> Behaviours - Add
Add mapping to your project and issue types
Fields -> Add -> Epic Link
Add server-side script on that field
if (getActionName() != "Create") { getFieldById(getFieldChanged()).setHidden(true)}
Hi!
Yes, it is possible. You should edit the Screen Scheme associated with the project to make 2 different screens for edit and view.
This article should help to understand this operation.
It will be looks like this
You have to customize the screen scheme definition. Basically make sure that "Epic link" field is available on create and view screen and not present on edit screen.
Please read the docs here as to how you can create screen scheme and map it with issueType
https://confluence.atlassian.com/adminjiraserver/associating-a-screen-with-an-issue-operation-938847289.html
@Mark Markov Thank you very much for your reply!
I've forgot to say that this should applied just for issues which have "Epic Link".
I've tried to use the following code:
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.Issuedef customFieldManager = ComponentAccessor.getCustomFieldManager();def epicLink = customFieldManager.getCustomFieldObjectByName('Epic Link');def epic = issue.getCustomFieldValue(epicLink);if (getActionName() != "Create" && epic) { getFieldById(getFieldChanged()).setHidden(true)}
However, I see the error: The variable [issue] is undeclared.
How can I check whether there is an 'Epic Link' ?
Thanks in advance.
@Grigory Salnikov
Thanks for your reply! I'm sorry I've forgot to say that this should applied just for issues which have "Epic Link". Thanks in advance.
@Tarun Sapra
Ok. I see. You're welcome!
Because behaviours doesnt have issue variable.
Try to use
def epic = underlyingIssue.getCustomFieldValue(epicLink);
instead
Ok, then please go with the answer provided by @Mark Markov
It looks like you're new here. Sign in or register to get started.