title: How to increment/update a issue custom Value in JIRA, based on its previous value?
body: <p>Hello I have a lot of automatic issue creation and commenting in JIRA. And wanted to add to the issue a customField named "Number of automatic updates" that increments everytime an issues is commented. The tipical solution for this is using the number of comments but that is not possible in because the comments are limited programatically to 20. So in this case I would always have at max 20.</p>
  
  <p>Is there any straightforward method that makes it possible to do so?</p>
  
  <p>I'm trying this approach but it keeps giving me exception and errors related to the CustomField Object:</p>
  
  <pre><code>MutableIssue issue = IM.getIssueObject(alreadyReportedIssueId);
  private static final String COMMENTNUMBER_CUSTOMFIELD_ID = "commentnumber-customfield-id";
  private static final CustomField customFieldObject = CustomFieldManager.getCustomFieldObjectByName(COMMENTNUMBER_CUSTOMFIELD_ID);
  issue.setCustomFieldValue(COMMENTNUMBER_CUSTOMFIELD_ID, (Integer.parseInt(customFieldObject.getValue(issue))++));
  </code></pre>
  
  <p>PS: The version of JIRA I'm using is: version 3.13.5</p>