Created
April 27, 2021 05:37
-
-
Save vikrantyadav11/224554971bafa7aab2f7389d4bc38ea1 to your computer and use it in GitHub Desktop.
Set scripted custom field value depending on other custom field selection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.jira.issue.Issue; | |
import com.atlassian.jira.issue.CustomFieldManager; | |
import com.atlassian.jira.issue.fields.CustomField; | |
import com.atlassian.jira.component.ComponentAccessor; | |
def member = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Member Rec") | |
def invest = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Investment") | |
def debit_creditor = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Debtor/Creditor") | |
def client_monies = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Client Monies") | |
def contributions = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Contributions") | |
def transfer_in = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Transfer In") | |
def investment_income = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Investment Income") | |
def risk_section = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Risk Section") | |
def refund = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Refunds") | |
def retirement_benefits = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Retirement Benefits") | |
def pensions = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Pensions") | |
def death_benefits = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Death Benefits") | |
def admin_expenses = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Admin Expenses") | |
def transfer_out = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Transfer Out") | |
def avc_section = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("AVC Section") | |
def legal_requirement = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Legal requirements") | |
def annual_report = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Annual Report") | |
def member_rec = issue.getCustomFieldValue(member); | |
def invest_value = issue.getCustomFieldValue(invest); | |
def debit = issue.getCustomFieldValue(debit_creditor); | |
def client = issue.getCustomFieldValue(client_monies); | |
def contri = issue.getCustomFieldValue(contributions); | |
def transfer = issue.getCustomFieldValue(transfer_in); | |
def investment = issue.getCustomFieldValue(investment_income); | |
def risk = issue.getCustomFieldValue(risk_section); | |
def refunded = issue.getCustomFieldValue(refund); | |
def retirement = issue.getCustomFieldValue(retirement_benefits); | |
def pension = issue.getCustomFieldValue(pensions); | |
def death = issue.getCustomFieldValue(death_benefits); | |
def adminex = issue.getCustomFieldValue(admin_expenses); | |
def tout = issue.getCustomFieldValue(transfer_out); | |
def avcsection = issue.getCustomFieldValue(avc_section); | |
def legal = issue.getCustomFieldValue(legal_requirement); | |
def annualr = issue.getCustomFieldValue(annual_report); | |
if (member_rec.toString() == "100%" && invest_value.toString() == "100%" && debit.toString() == "100%" && client.toString() == "100%" && contri.toString() == "100%" && transfer.toString() == "100%" && investment.toString() == "100%" && risk.toString() == "100%" && refunded.toString() == "100%" && retirement.toString() == "100%" && pension.toString() == "100%" && adminex.toString() == "100%" && tout.toString() == "100%" && death.toString() == "100%" && avcsection.toString() == "100%" && legal.toString() == "100%" && annualr.toString() == "100%") { | |
return "100%" } | |
else { | |
return "In Progress" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment