Hi,
In our company jira we have two custom post functions, which run after each other. The first one calls an external api and sets a custom field based on the returned value.
The second post function needs to retrieve the value in the custom field.
My problem is that when the functions are triggered, the first function writes the value, but in the second function i get null when I read that custom field.
The value is shown in the issue overview after the functions are run.
Relevant code:
Function 1, setting the value
customField.updateValue(
null,
issue,
new ModifiedValue<>("", String.valueOf(response.getData().getTaskId())),
new DefaultIssueChangeHolder()
);
Function 2, retrieving the value
CustomField customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(customFieldId);
Object value = task.getCustomFieldValue(customField); // null
Thanks in advance.
Hello and Welcome to Atlassian Community!
1. I recommend you to merge the 2 post-function into 1, especially if the second depend on the first.
2. Does your first script work? does the field get updated with a value eventually?
Hi,
1. I thought about that, maybe it's the best solution.
2. Yes, the value gets set, I can see it in the issue overview after all post functions have run. It's just that the second function cannot read the value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So try to combine them into one and see whats happen.
Let me know if it work or you still have an issue :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.