Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-17787

issue.getCustomFieldValue() not returning the expected value in a listener

XMLWordPrintable

    • 3.13
    • Severity 2 - Major
    • Hide
      Atlassian Update – 04 December 2017

      Hi everyone,

      We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, it's very low on our priority list, and will not be fixed in the foreseeable future. That's why we've decided to resolve it as Time Out.

      Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Jira team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details.

      We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication.

      Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments.

      Thank you,
      Ignat Alexeyenko
      Jira Bugmaster

      Show
      Atlassian Update – 04 December 2017 Hi everyone, We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, it's very low on our priority list, and will not be fixed in the foreseeable future. That's why we've decided to resolve it as Time Out . Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Jira team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details. We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication. Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments. Thank you, Ignat Alexeyenko Jira Bugmaster

      1. Create a custom field named "Example Readonly" of type "Readonly Text (<255)"
      2. Add it to the Default and Resolve screens on a new tab.
      3. Put some text value in the field, for example by using the SOAP updateIssue() method
      4. Create and install a listener that receives the ResolvedIssue event
      5. In the method that processes the event, try to get the value of the custom field.

                  Issue issue = event.getIssue();
                  CustomFieldManager cfm = ComponentManager.getInstance().getCustomFieldManager();
                  String fieldname = "Example Readonly";
                  CustomField myCustomField = cfm.getCustomFieldObjectByName(fieldname);
      
                  Object broken = issue.getCustomFieldValue(myCustomField);
                  Object working = myCustomField.getValue(issue);
      

      The bug is that the variable broken is always null, whereas the variable working can be cast to a String and is the correct value.

              Unassigned Unassigned
              73d805a2526b MattS
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: