Hello everyone - i have a piece of code on Behaviours On Load event to make 2 fields Read Only and to do that i am getting a custom field value.i added logging to see what values are coming to compare with.But in the logs i see the following line [Object Object].
please advise.
const fixVersions = getFieldById("fixVersions")
const group = "PM";
const locked = getFieldById("customfield_11185");
const lockedvalue = getFieldById("customfield_11185").getValue()
const myvalue = "The Value of Flag is"
logger.info(myvalue + lockedvalue)
fixVersions.setReadOnly(true)
locked.setReadOnly(true)
const user = await makeRequest("/rest/api/2/myself");
if (user) {
const { accountId } = user.body;
logger.info("account : " + accountId)
const userGroups = await makeRequest ("/rest/api/2/user/groups?accountId=" + accountId);
if (userGroups) {
const groupNames = userGroups.body.map(({ name }) => name);
logger.info("groupname : " + groupNames)
if (groupNames.includes(group)) {
fixVersions.setReadOnly(false)
locked.setReadOnly(false)
}
}
}
Behaviour Logs-
Timestamp: 2024-05-12T12:46:06.750Z
CorrelationId: aeb129ce-2e8e-4726-b5d0-17745482c0df
Field UUID: 4bab493d-aef2-4b01-b30e-d678126f037c
Field Name: customfield_11185,fixVersions
Event: On Load
Message: The Value of Flag is[object Object]
Level: info
View: Issue view