Sonar API search issues - sonarqube

I am trying to get the issues(bug,codesmells) through sonar API by using the following
/sonar/api/issues/search?pageSize=1&projectUuids=AV7s-_ldd2-CFpJxZLc4&types=BUG&createdAt=2017-11-08&resolved=false
Its working well, But what I am looking here is, instead of giving the date manually, Is it possible to pass the date which I will get it from script?
My codes :
wget.download('http://00.00.00.00:9090/sonar/api/project_analyses/search?project=project-id',out='file1.json',bar=None)
data = json.load(open('file1.json'))
date_time=(data["analyses"][0]["date"]).split("'")[0]
date=date_time[0:10]
print date
I need to pass the output(date) to,
/sonar/api/issues/search?pageSize=1&projectUuids=AV7s-_ldd2-CFpJxZLc4&types=BUG&createdAt=date&resolved=false
Any suggestion?

Call api/issues/search with a date format that respect one of the 2 formats:
2017-10-19T13:00:00+0200
2017-10-19

Related

Convert date format, BMC Remedy/smart-it

Problem:
In a field called $Detailed Decription$ sometimes dateformat 08/09/2021 is enterd and this need to be converted to swedish format 2022-02-11
I'am going to use BMC Developer studio and make a filter but i cant find a fitting solution for it. Replacing it wont work (i think) becaus it need to have a value to replace it with.
Maby there can be a function that reads regex (\d{2})/(\d{1,2})/(\d{4}) but how can i convert it?
If it's sometimes - look at AR System User Preferencje form. Check certain user's locale and date time config.
Also is important where the data comes from. Could be a browser setting or java script mod.
1- Using Set fields action, copy the date value from Detailed Description to a Date/Time field (i.e. z1D_DateTime01).
2- Using Set fields action and Functions (MONTH, YEAR, DAY, HOUR, MINUTE, SECOND) you can parse the date/time and convert it to format you like.
Something like this:
SwedishDate = YEAR($z1D_DateTime01$) + "-" + MONTH($z1D_DateTime01$) + "-" + DAY($z1D_DateTime01$)
This will capture the parts of date and combine them with "-" in the middle and in the order you want.

Jmeter give timestamp value in exponential format. How to convert it to number?

I used the ${__time()) function to convert the current time into a timestamp value in seconds.
The result I got was formatted like 1.543425678e9 instead of 1543425678.
My API doesn't accept this format. Can anyone help me out here?
example of setup function and store as variable
result in debug postprocessor:
time=1557263114733
Can you describe more detail about how you are using this function? Where are you seeing the output in the incorrect format?

OBIEE Passing Parameter to Analysis With URL

I have this Analysis that I wish to invoke from URL (which I can).
This analysis in particular is mounted on a dashboard and 6 of the 17 columns can be filtered from a prompt mounted on the same dashboard.
I only need the analysis and still be able to filter the results. I read about parameters that can be given to the URL, but I can't seem to make the filters work. I am using the &P0=n parameter and the consequent &P1=xx parameter.
Without the &P I am able to see the table, when I add parameters I get this error UH6MBRBC:E6MUPJPH.
Thanks for your time, have a nice day.
Got it to work by myself afterall (always best).
Basically instead of &p0 and such I used &coln and &valn (where n is the column number):
&coln - is the name of the field
&valn - is the value for which you filter
More information and better explanation can be found here.

Using Date Range in Google Search API with Ruby

I am using the google-search gem for Ruby found here.
And I'm trying to make my search within a custom date range.
results = Google::Search::Web.new(query: "SearchTerm daterange:2455197-2455562")
That doesn't seem to work and just ignores the daterange which is how you would do the search normally with Google. So it gives me the results for the term with no date range.
Does anyone have any experience with this? Or maybe there is a better solution.
NOTE: I have no experience with 'google-search' gem, following
solutions are NOT tested!
According to google docs, the api expects something like:
https://www.google.com/cse?cx=12345:example&q=lebanese+restaurant&sort=review-date:r:20090301:20090430
To make google-search populate this request for us, you could try two things:
Use order_by option (which is not documented but i imagine it will do sorting)
results = Google::Search::Web.new(query: "SearchTerm", order: "review_date:r:2455197-2455562")
2.According to gem ReadMe:
Arbitrary Query String Support
Arbitrary key / value pairs may be passed to Google::Search.new, all
options passed that are not assigned (deleted) will pass on to be part
of the query string.
So, theoretically we could do:
results = Google::Search::Web.new(query: "SearchTerm", sort: "review_date:r:2455197-2455562")
Give it a try!

Validate Start Time With Current Date In Sharepoint?

I have a column called Start Time (it's a SharePoint Default Calendar Column). I need to validate if the Start Time is less than today or not? Without using javascript? Is this possible?
I have tried this:
Created a column called Today type as Date and Time.
Default value is current date.
Then compared the Start Time and Today in validation settings like the following:
=[Start Time] < [Today]
it seems not working. help please?
Try this code instead of yours
=[Start Time]<NOW()
I use this to validate that Start Date must be less than or equal to Today:
=[Start Date]<=Today()
...and it works for me.

Resources