My client wants to be able to create a filter for issues where Field A has been updated in the last 7 days. As Jira doesn't have the ability to filter for updates made to specific custom fields I am trying to set up another date custom field (Field B) and using a ScriptRunner Listener to add the date every time field A is updated.
I have used some of the logic provided in this post: https://community.atlassian.com/t5/Jira-questions/Scriptrunner-listener-to-update-custom-date-time-field/qaq-p/387444
Specifically, the code below (although have changed the field names as needed).
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
def cfm = ComponentAccessor.getCustomFieldManager()
def watch = cfm.getCustomFieldObjectByName("% Complete")
def watchValue = event.issue.getCustomFieldValue(watch)
def updatedWatch = cfm.getCustomFieldObjectByName("% Complete Updated")
def today = new java.sql.Timestamp(new Date().getTime())
if (event.getChangeLog().getRelated('ChildChangeItem').find{ it.field == '% Complete'}){
def changeHolder = new DefaultIssueChangeHolder()
updatedWatch.updateValue(null, event.issue, new ModifiedValue(null, today), changeHolder)
}
This seems to be working and whenever I update Field A, Field B is populated with the date. However, when trying to build a JQL search for "Field B" > -7d it is not returning results, and when I try "Field B" is not EMPTY I also get no results. However, if I search for the specific key of an issue with Field B populated I can see the date populated in the column.
As a test, I manually updated Field B with tomorrows date which allows me to search for it in the issue navigator based on "Field B". I then updated Field A again which caused the Listener to update Field B with today;s date and viewing the issue in the issue navigator the date has been updated correctly to today's date. BUT, my JQL searches still seem to read it as tomorrows date, which I entered manually.
The JQL search only seems to be able to interpret the data I have manually entered into the field, and disregards amendments made by the Listener. Have I missed something obvious in the Listener code or is it known behaviour that JQL cannot parse data entered onto a field by a ScriptRunner listener?
Ok. So, the server hosting bitbucket, confluence and jira.
All services responde over internet: https://issues.osames.org
No firewall into server.
Bitbucket, confluence can access to marketplace (from the same server).
I do not know what to look for in Jira to find out more.
Edit: this is a resquest to markquetplace from the server using lynx:
$ lynx https://marketplace.atlassian.com/download/apps/1217129/version/1000140
Looking up marketplace.atlassian.com
Making HTTPS connection to marketplace.atlassian.com
Verified connection to marketplace.atlassian.com (subj=*.atlassian.com)
Certificate issued by: /C=US/O=Amazon/OU=Server CA 1B/CN=Amazon
Secure 128-bit TLS1.2 (ECDHE_RSA_AES_128_GCM_SHA256) HTTP connection
Sending HTTP request.
HTTP request sent; waiting for response.
HTTP/1.1 302 Found
Allowing this cookie.
Data transfer complete
HTTP/1.1 302 Found
Using https://marketplace-cdn.atlassian.com/files/artifact/2eef5e0d-03b4-4a38-8de0-4176fe0cb24a/jira-jigit-plugin-1.2.4.jar
Looking up marketplace-cdn.atlassian.com
Making HTTPS connection to marketplace-cdn.atlassian.com
Verified connection to marketplace-cdn.atlassian.com (subj=*.atlassian.com)
Certificate issued by: /C=US/O=Amazon/OU=Server CA 1B/CN=Amazon
Secure 128-bit TLS1.2 (ECDHE_RSA_AES_128_GCM_SHA256) HTTP connection
Sending HTTP request.
HTTP request sent; waiting for response.
HTTP/1.1 200 OK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Could you check that you have internet access from the host where the Jira instance is installed?
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.