Hi Community, Just want to ask if I can make System Fields such as Priority to be a dynamic form.
I do have backup , which is literally scriptrunner , but I want to make it easier if its possible
Scenario is we have 4 Levels of Priority and the default value is Priority 4, when an agent is editing an issue in Edit Screen, if the agent change the value of Priority 4 to Priority 1 or Priority 2, related fields must be filled-up , if Priority 3 or 4 , nothing will be filled up
I have this script on my behavior as a backup but I think it is not working as what I've expect because it still requires me to fill up related fields even if the Priority is 3 or 4
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
def samplefield = getFieldById("customfield_xxxxx")
def priority = getFieldByName("xxxxx")
if(priority.getValue()==("Priority 1") || ("Priority 2"))
{
samplefield.setRequired(true)
} else if(priority.getValue()==("Priority 3" || ("Priority 4") {
samplefield.setRequired(false) }
Can you help me guys out of this problem? Thank you!
you need to setup a validator on the workflow when create.
string errorMsg = "Mandatory"
if (priority== "3" || priority == "4") {
return false, relatedField, errorMsg;
}
https://confluence.cprime.io/display/TR/Validators#Validators-Validationbasedonregularexpression
Hi @Romy T. , I am referring to the edit screen, let's say if the issue is already created. Then the agent wants to Edit the Priority Field on Edit Screen, if the agents selects Priority 1 or 2 , related fields must come up
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alvin
you need to create two file.
main.sil
if(argv["screen"] == "edit"){
lfInstantHook({
"project",
"related-field","relatedField"
}, "/edit.sil");
lfWatch("priority", {"priority","relatedField"}, "/showRelatedField.sil", {"change"});
}
edit.sil
if(argv["priority"] == "1" || argv["priority"] == "2") {
lfShow("relatedField");
}
else{
lfHide("relatedField");
}
read this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Romy T. , will take a look at this one, but I need to get Scriptrunner opinions first, because I already have scriptrunner installed. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Fudeu fdo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i use Power Script for JIRA - Live Fields to control Dynamic Form.
Disclaimer:
just a user, not a seller.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Romy T. ,Thank you for a quick-turn around, can you show me examples on how you do it? or how about Scriptrunner?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.