Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • Why does the text ~ search syntax pick up the previous version of a post edited through the API?

Automation Rules Generating Excessive Issue History Entries

John Tucci
Contributor
July 11, 2022

Hello, Again, Community:

My question this time has to do with automation rules and Jira issue History. I have developed an automation scheme to detect Jira issues that spend more than a predefined number of workdays in each status column. This scheme executes two different automation rule-sets five nights a week. Each rule-set generates an entry into each issue History. After even just a few nights of rule execution, the issue History gets cluttered to the point where it is impossible to find relevant info about the issue.

Is there a way to prevent/block automation rules from writing to issue history?

My continued "Thanks" for this community's generous and helpful knowledge.

BTW...We're using Team-Managed Kanban.

-John Tucci

1 answer

0 votes
Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 11, 2017

Hi Dillon,

Do you use REST API or Java API (say, with Script Runner)? One case where this would happen is if you somehow make the changes without reindexing the issue. Please check that or post the code of how exactly you are updating the issue.

I'm also intrigued by "oldDisplayValue". Could you please post a larger part of JSON around this property, up to the field level?

Cheers,
Igor

Dillon Brown
August 14, 2017

Igor, thanks for the response. I'm not actually the programmer myself, but here's the info I received. We use the REST API.

HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; request.ContentType = "application/json"; request.Method = method; // POST   if (data != null) {     using (StreamWriter writer = new StreamWriter(request.GetRequestStream()))     {         writer.Write(data);     } }

 

“data” consists of something like the following. Each of those are pushed in separate chunk. (e.g. in the case of the following, it makes three “writes” to the post, to /rest/api/latest/issue/[postid]  

{"update": {"summary": [{"set": "Test | Test"}]}}  

{"update": {"description": [{"set": "Test\r\n\r\n----\r\n\r\nTest\r\n{color:lightgray}Test{color}"}]}}  

{"update": {"comment": [{"edit": {"id":[id],"body":"Test\r\n\r\n----\r\n\r\nTest\r\n{color:lightgray}Test{color}"} }]}}

The programmer also said that he only sees an option to reindex the whole site, which would take too long and can only be done by a site admin.

Here's a bit more of the JSON:

        "author" : "XXX",
        "created" : 1495678441000,
        "items" : [ {
          "fieldType" : "jira",
          "field" : "description",
          "oldDisplayValue" : "Testing auto-translation\r\n\r\n[~accountname]",
          "newDisplayValue" : "Testing auto-translation\r\n\r\n----\r\n\r\n自動翻訳テスト\r\n{color:lightgray}#t9n{color}"

 

Thanks!

Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 14, 2017

Hi Dillon,

Thanks for the details. The REST API should reindex the issue, so I guess my idea was not related to this case.

The "oldDisplayValue" seems to come from the history of changes, which is not searched with "text ~".

Have you tried "description ~ value" instead of "text ~ value"?

Kind regards,
Igor

Dillon Brown
August 14, 2017

Hi Igor, thanks for your prompt responses!

We are also looking for mentions in comments, so just "description ~ value" wouldn't work, but we did originally try with "(description ~ value OR comment ~ value OR summary ~ value)" and narrowed it down to picking up on "comment ~ value". That may be relevant information, actually, if the only part of an issue we have touched with the API is the description, it does NOT return a false positive in the query. This only occurs for the comments, and according to the JSON file, oldDisplayValue is the only place in the comment that the string occurs, so it appears to us as though something is causing "text ~ value" (or "comment ~ value") to pick that up.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events