I have a custom "Field A" that needs to be populated with the date/time when another custom "Field B" was set to "Yes".
I need to create a script that:
This is what I have so far:
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser.class)
def searchProvider = ComponentAccessor.getComponent(SearchProvider.class)
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def query = jqlQueryParser.parseQuery("myJQL")
def results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())
//code to get date/time when "Field B" was set to "Yes"
//code to add the date/time to "Field A"
I think there's no direct way, you need to query the rest api for the changelog of every issue, check the modifications and derive the date from this information.
then you can add the date to another field for querying
it depends on your needs, for example if I need to record the first date that the field changed:
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in talking to 20 people planning t...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs