I'm trying to create a Script Behaviour to make the Account Field(Locked & from Tempo) required when the issue type is selected as an epic during issue creation. and if the account value is chosen as 'xyz' the 2 other fields should be set as required.
When I tried to get the Account field in script behaviour, it was unidentified.
const accountField = getFieldById('customfield_xxxxx');
- I've taken the custom field ID from the Jira Admin custom field, but it is not taking it.
- I tried with getFieldByName("Account") still no luck
- I also checked from Tempo but could not find the ID.
- Well this is working in Workflow Script Validator. But I do have hundreds of workflows in my Jira instance and adding the validator in each workflow is not done.
I want to make this change globally.
Let me know if there is any way to solve this
Thanks in Advance!
Community moderators have prevented the ability to post new answers.
Dear Vruti,
Thanks for reaching out the Atlassian Community!
It seems like you're encountering difficulties accessing the Account field in your Script Behaviour. To address this issue, we may need to troubleshoot and find an alternative method to retrieve the field.
Here are some steps you can take:
Check Field Configuration:
Ensure that the Account field is associated with the relevant screens for the Epic issue type. Sometimes, fields may not be visible or accessible if they are not included in the screens associated with the issue type.
Inspect HTML Source:
You can inspect the HTML source of the Create Issue screen in your browser to find the ID or name of the Account field. Look for the input element associated with the Account field and note down its ID or name.
Use REST API:
You can use Jira's REST API to retrieve information about the custom field, including its ID. You can make a request to the rest/api/2/field endpoint and search for the Account field by its name.
Once you have identified the correct ID or name of the Account field, you can use it in your Script Behaviour to access the field and apply the necessary logic.
Thanks,
Durgesh Masurkar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.