Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,204
Community Members
 
Community Events
165
Community Groups

Is it possible that Jira caches field values ?

Edited

To get the value of a field I normal do:

Optional<CustomField> employeeCustomField =getCustomfieldByName(MAILCONTAKT_EMPLOYEE);
String employeeCustomFieldValue = (String) someIssue.getCustomFieldValue(employeeCustomField.get());

And normally it worked.

But now to test it , I cloned the issue with all its subissues. 

And I always update the respective field with a new value. Then I clone again and update again the field and so on.

First and second time in the log I saw it retrieved the new value.

But later even if I updated the field value in the issue , I curiously got the old value.

Even if I update again , I still get the old value. So all updating has no more effect.

That already cost me hours and hours. But I really do not know  why and how it can still get the old value.

1 answer

0 votes

Where are you running this?  And what is the rest of the script doing?

I run it in a postfunction outsourced to an own plugin

Ok, what does the rest of the postfunction do?

it calls a REST Api and sending the data retrieved from the issue fields.

Ok, so can you walk through replicating this problem?  You've talked about cloning and updating issues, but I think we need to see the whole thing (that's why I asked about the rest of the post-function - I didn't know if you were cloning/updating in there).  If you could sketch out something like:

  • Clone ABC-123 to create ABC-456
  • Amend field on ABC-456
  • Transition issue, going through my post-function that
    • Gets some data from <remote system>
    • Works out what to do with it
    • Updates the employee field (as per posted code)
  • And then say where the problem occurs - like "the employee field on ABC-456 remains as what was on ABC-123", or "I clone ABC-456 and do exactly the same process creating ABC-789, but the employee field takes on the value from ABC-123"

That would be really helpful

There is a issue of type order . And it has subissue connected to it of type person

So I trigger a postfunction in order and it will read field contactaddress from person and send it to backend. So because I cannot trigger the postfunction again , I need to clone the order issue with person issue will also be connteced to the clone. If I now change value of field contactaddress in person and again trigger the clone order issue I would expect that the updated value will be sent to backend . But this is not the case. Instead old value is read and sent to backend. Honestly I do not know where this old value is available. Really weird.

I am sorry, but I am struggling to understand what your process steps are there.  Could you go over it again, but use Jira actions to explain it, and differentiate between the different issues? 

It is unclear what your "need to clone" and "send to back end" mean, and what issue you are talking about.  I understand that you have an order issue type and a person issue type, but there are at least three separate issues involved in your walkthrough and I cannot tell which ones you are talking about when you just say "order" or "person"

We really do need to have this done in jira-speak - something like:

  • I create a new issue (type order), it gets called ABC-123
  • I create three sub-tasks beneath it (type person), they are ABC-124, ABC-125, ABC-126
  • I transition ABC-123 from "new" to "in progress", which makes my post-function run
  • I edit ABC-123, changing the field contactaddress

and so-on.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

159 views 1 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you